erik.t.irgens@gmail.com • (757) 968 2445
1215 Seneca Street - Seattle, WA
https://erikirgens.com • https://github.com/erik-t-irgens
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
// This function uses an array that is filled with the fibonacci sequence up to the provided digit, then returns the last result. This is known as iterative. | |
getNthFib = (n) => { | |
let fibArray = [0, 1] | |
if (n < 3) { | |
return fibArray[n - 1] | |
} else { | |
for (let i = 2; i < n; i++) { | |
fibArray.push(fibArray[i - 2] + fibArray[i - 1]) | |
} | |
return fibArray[n - 1] |
I hereby claim:
- I am erik-t-irgens on github.
- I am sareth740 (https://keybase.io/sareth740) on keybase.
- I have a public key ASCxTrVOZYbwlMozrYo-Yx91oiUXiXzs2UgOJmhtcUiZcgo
To claim this, I am signing this object: