var each = require('{%= name %}');
var result = [];
each([1, 2, 3, 4, 5, 6], function(ele, next) {
result.push(ele * (i + 1));
next();
}, function (err) {
console.log(result);
//=> [ 1, 4, 9, 16, 25, 36 ]
});
Params
array
{Array} - (required) Array of elements to loop overnext
{Function} - (required) Function to call on each element in the arraycallback
{Function} - (required) Final callback function, called afternext
is called on each element in the array.