A Fibonacci sequence of numbers is when the next number in sequence is found by adding up the two previous numbers.
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...
As a Fibonacci sequence approaches infinity, the ratio between each number and the previous number approaches the Golden Ratio Phi
Phi (approximately 1.618034) is an irrational constant like Pi or e
If line A is divided into 2 segments, and the ratio of length A to length B is equal to the ratio between B to C, it will be Phi, the Golden ratio 1.618...
For more information on Phi visit the Golden Number
Generating the Nth Fibonacci number (recursive, iterative or formula?)
A recursive fibonnacci function
To get the Nth Fibonacci number, we will need to obtain the previous 2, and then, the next previous 2 until we get to our base cases 0 and 1.
An Iterative fibonnacci function
* the shift() removes the first item in the array and returns that item; the length of the array also gets reduced by one