Created
August 14, 2017 10:08
-
-
Save hrumhrumble/88c1256bcc79e0b9b4a8a7f17a001771 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
let list = { | |
value: 1, | |
next: { | |
value: 2, | |
next: { | |
value: 3, | |
next: { | |
value: 4, | |
next: null | |
} | |
} | |
} | |
}; | |
function printReverseList(list) { | |
if (list.next) { | |
printReverseList(list.next); | |
} | |
console.log( list.value ); | |
} | |
printReverseList(list); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment