【发布时间】:2017-11-21 15:51:57
【问题描述】:
不久前我被介绍给 lodash,我遇到了一个似乎很简单的挑战。
我正在使用_.forEach() 循环对打字稿中的数组对象执行函数。但我需要知道它何时到达最后一次迭代以执行特定功能。
_.forEach(this.collectionArray, function(value: CreateCollectionMapDto) {
// do some stuff
// check if loop is on its last iteration, do something.
});
我检查了这个文档或任何与 index 相关的文档,但找不到任何东西。请帮帮我。
【问题讨论】:
标签: typescript lodash