If you use the index for any of the code while using _.each, You can get the index of the current iteration by adding another parameter to your iteratorĀ function
_.each([array], function (val, i) {
//here val iterator function and i will be the index
});