Skip to content

Instantly share code, notes, and snippets.

@thattommyhall
Last active December 11, 2015 20:49
Show Gist options
  • Save thattommyhall/4658370 to your computer and use it in GitHub Desktop.
Save thattommyhall/4658370 to your computer and use it in GitHub Desktop.
Coffeescript fib
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