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

8 lines
191 B
JavaScript
Raw Normal View History

export function fibonacci(value) {
// implementar logica aqui
if (value === 0 || value === 1){
2022-10-29 01:52:07 +00:00
return value
}else{
return fibonacci(value - 1) + fibonacci(value - 2)
}
}