Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/TheAlgorithms/JavaScript
/ fibonacci
Function
fibonacci
Recursive/FibonacciNumberRecursive.js:9–14 ·
view source on GitHub ↗
(n)
Source
from the content-addressed store, hash-verified
7
*/
8
9
const
fibonacci = (n) => {
10
if
(n < 2) {
11
return
n
12
}
13
return
fibonacci(n - 2) + fibonacci(n - 1)
14
}
15
16
export
{ fibonacci }
Callers
2
Memoize.test.js
File · 0.90
FibonacciNumberRecursive.test.js
File · 0.90
Calls
no outgoing calls
Tested by
no test coverage detected