Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

fibonacci sequence array

function fib(n){  let arr = [0, 1];  for (let i = 2; i < n + 1; i++){    arr.push(arr[i - 2] + arr[i -1])  } return arr[n]}
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #fibonacci #sequence #array
ADD COMMENT
Topic
Name
6+8 =