fibonacci sequence
function _fib(number) {
if (number === 0 || number === 1) {
return number;
} else {
return _fib(number - 1) + _fib(number - 2)
}
}
fibonacci sequence
function _fib(number) {
if (number === 0 || number === 1) {
return number;
} else {
return _fib(number - 1) + _fib(number - 2)
}
}
Fibonacci sequence
function myFib(n) {
if (isNaN(n) || Math.floor(n) !== n)
return "Not an integer value!";
if (n === 0 || n === 1)
return 3;
else
return myFib(n - 1) + myFib(n - 2);
}
console.log(myFib(5));
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us