I created this repo to show my logic to Fibonacci sequence and futuraly refactor with new features from javascript
First of all i needed to read a human function to fibonacci sequence.
The Fibonacci sequence is a set of numbers that starts with a one or a zero, followed by a one, and proceeds based on the rule that each number (called a Fibonacci number) is equal to the sum of the preceding two numbers.
After that i needed to translate this to javascript world. firstly i think about the params of the function: totalNumberOfSequence, a array to get this params and transform to your length fibArray.
I give the first and second index from fibArray to initiate the sequence; create a logic loop to get a sequence from the third index and add a new number in array with fibonacci logic.
fibArray[i] = fibArray[i - 2] + fibArray[i - 1]
- Refactoring with new javascript features
