TypeScript 2021.8.17 2021.9.17 96 1 TypeScript 遍历数组 数组增加减少元素 参考文档 TypeScript TypeScript 遍历数组 1 2 3 4 5 6 let someArray = [1, "string", false]; for (let entry of someArray) { console.log(entry); // 1, "string", false } for of怎么获取index 1 2 3 4 5 let someArray = [1, "string", false]; for (let index, entry of someArray.entries()) { console.log(index, entry); // 1, "string", false } 数组增加减少元素 array1.push(xxx) 参考文档 菜鸟教程typescript typescript handbook liuliancao https://blog.liuliancao.com/roams/typescript/ CC BY-NC-SA 4.0