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

6 lines
147 B
JavaScript
Raw Normal View History

export function fibonacci(value) {
2022-10-28 21:04:24 +00:00
if (value === 0 || value === 1){
return value;
}
return fibonacci(value -1) + fibonacci(value -2);
}