6 lines
147 B
JavaScript
6 lines
147 B
JavaScript
export function fibonacci(value) {
|
|
if (value === 0 || value === 1){
|
|
return value;
|
|
}
|
|
return fibonacci(value -1) + fibonacci(value -2);
|
|
} |