Answers for "e fibonacci sequence"

1

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));
Posted by: Guest on August-17-2021

Python Answers by Framework

Browse Popular Code Answers by Language