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

8 lines
167 B
JavaScript
Raw Normal View History

export function fibonacci(value) {
// implementar logica aqui
2022-10-28 11:40:50 +00:00
if (value <= `${1}`) {
return value;
}
return fibonacci(value - 1) + fibonacci(value - 2);
}