Created
March 19, 2018 20:07
-
-
Save waimyokyaw/1f1e45ce0cdb64fcd5985e1b31706c73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fibonacci_series = (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)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment