Skip to content

Instantly share code, notes, and snippets.

View niinpatel's full-sized avatar
💭
goofing off

Nitin Patel niinpatel

💭
goofing off
View GitHub Profile
@djedr
djedr / lisperator-problem-extended-25-11-2016.js
Last active May 29, 2019 19:38
My solution to "A little JavaScript problem" from lisperator.net [ http://lisperator.net/blog/a-little-javascript-problem/ ], with comments.
/**
* @file Solution to "A little JavaScript problem" from [lisperator.net]{@link http://lisperator.net/blog/a-little-javascript-problem/}.
*
* For demonstration. Overdocumented on purpose. Documentation is in a JSDoc-like documentation style.
* The solution itself is 7 SLOC.
* I also included test code to automatically verify correctness of the solution.
* See {@link https://gist.github.com/djedr/68fdaef3cad134788caefac06388534c} for a version without documentation or test code.
*
* Assumes ES6 support.
* Uses nested closures to emulate singly linked lists.