Created
October 7, 2014 00:14
-
-
Save dpzmick/4f7c138fd2bd6b0731bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function make_node(value) { | |
return { | |
value: value, | |
next: null, | |
}; | |
} | |
var first = make_node(1); | |
var second = make_node(2); | |
var third = make_node(4); | |
first.next = second; | |
second.next = third; | |
var head = first; | |
var current = first; | |
while (current !== null) { | |
console.log(current.value); | |
current = current.next; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment