OneCompiler

find fibonacci sequence in js

1617

Example heading with h2 size

Example heading with h3 size

Following is sample java code.


function fib(n){
    let fib = [0,1]
    for(let i = 2 ;i < n ; i++){
        fib[i] = fib[i-1]+fib[i-2]
    }
    return fib
}
console.log(fib(9))