Last active
December 11, 2015 20:49
-
-
Save thattommyhall/4658370 to your computer and use it in GitHub Desktop.
Coffeescript fib
This file contains 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
fib = (n) -> | |
r = [1,1] | |
for i in [2...n] | |
r.push(r[i-1] + r[i-2]) | |
r | |
console.log fib(5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment