forked from M3-Academy/challenge-algorithms-v2.0
feat(04-fibonacci): Adiciona função
This commit is contained in:
parent
6c1bf006f4
commit
6abc22ea8e
@ -1,4 +1,8 @@
|
|||||||
export function fibonacci(value) {
|
export function fibonacci(value) {
|
||||||
// implementar logica aqui
|
// implementar logica aqui
|
||||||
|
if (value === 0 || value === 1) {
|
||||||
|
return value;
|
||||||
|
} else {
|
||||||
|
return fibonacci(value - 1) + fibonacci(value - 2);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user