📅  最后修改于: 2022-03-11 15:01:56.802000             🧑  作者: Mango
var fib = function(n) {
if (n === 1) {
return [0, 1];
} else {
var arr = fib(n - 1);
arr.push(arr[arr.length - 1] + arr[arr.length - 2]);
return arr;
}
};
console.log(fib(2));