challenge-algorithms-v2.0_c.../04-fibonacci/index.js

7 lines
135 B
JavaScript

export function fibonacci(value) {
if(value < 2) {
return value
}
return fibonacci(value - 1) + fibonacci(value - 2)
}