Created
July 21, 2020 00:45
-
-
Save spiterman/33033a45e5bdfb758cd909a28d3c4431 to your computer and use it in GitHub Desktop.
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
function nThFibonacciTable(n) { | |
let table = [1, 1] | |
for (let i = 2; i <= n; i++) { | |
let nextFib = table[i - 1] + table[i - 2] | |
table.push(nextFib) | |
} | |
return table[n] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment