Skip to content

Instantly share code, notes, and snippets.

@0chroma
Created January 13, 2013 08:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0chroma/4522915 to your computer and use it in GitHub Desktop.
Save 0chroma/4522915 to your computer and use it in GitHub Desktop.
I'm so sorry
var jerk = function(num, i, original){
if(!i) i=1;
var out = {id: i};
if(!original) original = out;
if(i == num)
out.jerk = original;
else
out.jerk = jerk(num, i+1, original);
return out;
}
console.log(jerk(8));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment