Skip to content

Latest commit

 

History

History
20 lines (16 loc) · 526 Bytes

.verb.md

File metadata and controls

20 lines (16 loc) · 526 Bytes

Usage

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 over
  • next {Function} - (required) Function to call on each element in the array
  • callback {Function} - (required) Final callback function, called after next is called on each element in the array.