This document defines a recursive function to calculate Fibonacci numbers, where fibonacci(n) returns the nth Fibonacci number by recursively calling itself with arguments n-1 and n-2, and base cases return 1 if n is less than 2.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
80 views1 page
Fibonacci Recrsion Javascript
This document defines a recursive function to calculate Fibonacci numbers, where fibonacci(n) returns the nth Fibonacci number by recursively calling itself with arguments n-1 and n-2, and base cases return 1 if n is less than 2.