相关文章推荐
酷酷的烈马  ·  java 调用 ...·  5 月前    · 
没人理的大熊猫  ·  Leetcode 2278. ...·  1 年前    · 
独立的红豆  ·  iphone - How to read ...·  1 年前    · 
腹黑的烈酒  ·  nltk.download('punkt') ...·  1 年前    · 
let arr: string[] = ["小昆虫1", "小昆虫2", "小昆虫3"];
// 遍历数组值
console.log("遍历数组值=========================");
for (let item of arr) {
    console.log(item);
// 遍历数组索引
console.log("遍历数组索引=========================");
for (let item in arr) {
    console.log(item);
// 遍历数组索引和值
console.log("遍历数组索引和值=========================");
for (let item in arr) {
    console.log(item, arr[item]);

https://github.com/smallinsect/MyJS/blob/main/TypeScript/for.ts