SyntaxFix
Write A Post
Hire A Developer
Questions
You can refer to below simple recursive function.
function fib(n){ if (n <= 2) return 1; return fib(n-1) + fib(n-2); } console.log(fib(10)) //55 // Pass on any value to get fibonacci of.