Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on JavaScript developer, can you reverse a linked list?.
http://jsbin.com/ugojoq/267/edit
LinkedList.prototype.reverse = function () {
var start = this.head; var prev = this.head; var curr = prev.next; prev.next = null; while(curr !== null) { var next = curr.next; curr.next = prev; prev = curr; curr = next; } this.head = prev;
There are no comments on this comment yet.
http://jsbin.com/ugojoq/267/edit
LinkedList.prototype.reverse = function () {
};