TypeScript for … of with index / key?

后端 未结 0 1893
隐瞒了意图╮
隐瞒了意图╮ 2020-12-23 02:41

As described here TypeScript introduces a foreach loop:

var someArray = [9, 2, 5];
for (var item of someArray) {
    console.log(item); // 9,2,5
}

相关标签:
回答
  • 消灭零回复
提交回复
热议问题