10 lines
240 B
JavaScript
10 lines
240 B
JavaScript
export function fibonacci(value) {
|
|
// implementar logica aqui
|
|
if (value < 1) {
|
|
return 0
|
|
} else if (value <= 2) {
|
|
return 1
|
|
} else {
|
|
return (fibonacci(value - 1) + fibonacci(value - 2))
|
|
}
|
|
} |