Skip to content

Instantly share code, notes, and snippets.

@lefuturiste
Created March 18, 2019 21:17
Show Gist options
  • Save lefuturiste/38b1648d40013275beb80dcf0e21cbc6 to your computer and use it in GitHub Desktop.
Save lefuturiste/38b1648d40013275beb80dcf0e21cbc6 to your computer and use it in GitHub Desktop.
Fibonacci
let len = process.argv[2] == undefined ? 100 : process.argv[2]
let terms = [1, 1]
for(let i = 2; i < len; i++) {
terms.push(terms[i-2] + terms[i-1])
}
console.log(terms)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment