Return the first N items of the Fibonacci sequence.
The input will be a whole number greater than or equal to zero.
The output should be iterable.
Examples:
(0) => [0]
(5) => [0, 1, 1, 2, 3, 5]
(9) => [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
*^You can assume that you will always recieved valid input
Language: Javascript ES6
Length: 59
Solution: Further optimisation - Correct for all values of n>=0. (Behaves as previous example for all negative values of n except for n=-2, but this annoyance is not required by the problem)
f=n=>n<2?[0,1].slice(0,n+1):(a=f(n-1),a[n]=a[n-1]+a[n-2],a)