SyntaxFix
Write A Post
Hire A Developer
Questions
You can get the index of the current iteration by adding another parameter to your iterator function, e.g.
function
_.each(['foo', 'bar', 'baz'], function (val, i) { console.log(i + ": " + val); // 0: foo, 1: bar, 2: baz });