forked from M3-Academy/challenge-algorithms-v2.0
feat(04-fibonacci)executa exercicio 4
This commit is contained in:
parent
797e1de18a
commit
3bcd58687b
@ -1,4 +1,11 @@
|
|||||||
export function fibonacci(value) {
|
export function fibonacci(value) {
|
||||||
// implementar logica aqui
|
// implementar logica aqui
|
||||||
|
if (value === 0){
|
||||||
|
return value
|
||||||
|
}else if (value === 1) {
|
||||||
|
return value
|
||||||
|
}else{
|
||||||
|
return fibonacci(value - 1) + fibonacci(value - 2)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user