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

11 lines
215 B
JavaScript

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