challenge-algorithms-v2.0-t.../04-fibonacci/index.js
2022-10-28 23:57:25 -03:00

6 lines
176 B
JavaScript

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