Created
January 23, 2016 02:31
-
-
Save kaw2k/16ad1e6f489702106182 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 listNode(value, next) { | |
return { | |
value: value, | |
next: next | |
}; | |
} | |
var three = listNode(3); | |
var two = listNode(2, three); | |
var one = listNode(1, two); | |
// Or more concisely | |
var one = listNode(1, listNode(2, listNode(3))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment