I got introduced to lodash not too long ago and I'm having what seems to be a simple challenge with it.
I am using a _.forEach() loop to perform a function on objects of an Array in typescript. But I need to know when it gets to the last iteration to perform a specific function.
_.forEach(this.collectionArray, function(value: CreateCollectionMapDto) {
// do some stuff
// check if loop is on its last iteration, do something.
});
I checked the documentation for this or anything to do with index but could not find anything. Please help me.