📅  最后修改于: 2022-03-11 14:47:39.101000             🧑  作者: Mango
let labels = [];
repeat(5, i => {
labels.push(`Unit ${i + 1}`);
});
console.log(labels);
// → ["Unit 1", "Unit 2", "Unit 3", "Unit 4", "Unit 5"]