Created
June 22, 2020 15:16
-
-
Save pomle/9dec8cde11fa965fabd89e0812d71222 to your computer and use it in GitHub Desktop.
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
const fib = (n) => { | |
let a = 0, b = 1, c; | |
for (let i = 0; i < n; i++) { | |
c = a; | |
a = b + a; | |
b = c; | |
} | |
return a; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment