Skip to content

Instantly share code, notes, and snippets.

@spiterman
Created July 21, 2020 00:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spiterman/33033a45e5bdfb758cd909a28d3c4431 to your computer and use it in GitHub Desktop.
Save spiterman/33033a45e5bdfb758cd909a28d3c4431 to your computer and use it in GitHub Desktop.
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