challenge-algorithms-v2.0-e.../04-fibonacci/index.js
2022-10-29 14:00:04 -03:00

8 lines
190 B
JavaScript

export function fibonacci(value) {
// implementar logica aqui
if (value === 0 || value === 1) {
return value;
} else {
return fibonacci(value - 1) + fibonacci(value - 2);
}
}