📅  最后修改于: 2022-03-11 14:48:11.429000             🧑  作者: Mango
'use strict';
let fibonacci: number[] = [0, 1];
function listFibonacci(num: number) {
for (let i: number = 2; i < num; i++) {
fibonacci[i] = fibonacci[i - 2] + fibonacci[i - 1];
}
return fibonacci;
}
console.log(listFibonacci(10));