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

7 lines
171 B
JavaScript
Raw Permalink Normal View History

export function fibonacci(value) {
// implementar logica aqui
2022-11-01 23:09:03 +00:00
if (value <= 1) {
return value;
}
return fibonacci(value - 1) + fibonacci(value - 2);
};