Skip to content

Commit f24f6a3

Browse files
Merge pull request akshitagit#90 from bidetaggle/master
Print the Fibonacci series for n=20 akshitagit#45
2 parents 2d66a83 + abf7c20 commit f24f6a3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Maths/fibonacci_new.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
let fibonacci = (n, seq=[0,1]) => --n > 0
2+
? fibonacci(n, seq.concat([seq[seq.length - 1] + seq[seq.length - 2]]))
3+
: seq
4+
5+
console.table(fibonacci(20))

0 commit comments

Comments
 (0)