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

10 lines
212 B
JavaScript
Raw Normal View History

export function fibonacci(value) {
// implementar logica aqui
2022-10-30 12:27:58 +00:00
if (value < 1) {
return 0
} else if (value <= 2) {
return 1
} else {
return (fibonacci(value - 1) + fibonacci(value - 2))
}
2022-10-30 12:27:58 +00:00
}