Recently I started using lodash and encountered a simple challenge while working with it.
I'm currently utilizing a _.forEach()
loop in typescript to apply a function to objects within an Array. However, I need to determine when the loop reaches its last iteration in order to execute a specific task.
_.forEach(this.collectionArray, function(value: CreateCollectionMapDto) {
// perform tasks
// check for last iteration and execute action
});
I searched through the documentation but couldn't find any information regarding index
. I would appreciate any assistance on this matter. Thank you.