SOURCE

function fb(n) {
    if (n <= 2) {
        return 1;
    } else {
        return fb(n - 1) + fb(n - 2)
    }
}

function fn(n) {
    var arr = [];
    for (var i = 1; i <= n; i++) {
        arr.push(fb(i))
    }
    return arr
}

console.log(fn(10));



console 命令行工具 X clear

                    
>
console