Skip to content

Instantly share code, notes, and snippets.

@earino
Created April 8, 2013 19:38
Show Gist options
  • Save earino/5339812 to your computer and use it in GitHub Desktop.
Save earino/5339812 to your computer and use it in GitHub Desktop.
least readable javascript fibonacci sequence in javascript?
function fib( n ) {
var a = 1, b = 1;
for (i = 3; i <= n; i++) {
b = [a, a += b][0];
}
return n == 0 ? 0 : a;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment