create fibonacci code

This commit is contained in:
shreyasingh28 2019-10-07 10:45:00 +05:30 committed by GitHub
parent dc1047df72
commit 809a3940fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

16
fibb.js Normal file
View File

@ -0,0 +1,16 @@
var fibonacci_series = function (n)
{
if (n===1)
{
return [0, 1];
}
else
{
var s = fibonacci_series(n - 1);
s.push(s[s.length - 1] + s[s.length - 2]);
return s;
}
};
console.log(fibonacci_series(8));