Created
February 13, 2017 02:59
-
-
Save miguelludert/8e5ae19e57943ff4c10f2dd616455801 to your computer and use it in GitHub Desktop.
Linked List Madness
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 valuesToList() { | |
var head, tail; | |
head = tail = { value : arguments[0] }; | |
for(var i = 1; i < arguments.length; i++){ | |
tail = tail.next = { value : arguments[i] }; | |
} | |
return head; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment