Created
April 8, 2013 19:38
-
-
Save earino/5339812 to your computer and use it in GitHub Desktop.
least readable javascript fibonacci sequence in javascript?
This file contains hidden or 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
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