Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/modules / ___dist / chain-able / src / deps / loop / each / arrayEach.js
Size: Mime:
"use strict";

const isNill = require("../../is/nullOrUndefined");
/**
 * A specialized version of `forEach` for arrays.
 * @since 5.0.0-beta.5
 * @memberOf loop
 *
 * @param {Array} [array] The array to iterate over.
 * @param {Function} iteratee The function invoked per iteration.
 * @return {Array} Returns `array`.
 */


function arrayEach(array, iteratee) {
  let index = -1;
  const length = isNill(array) ? 0 : array.length;

  while (++index < length) {
    if (iteratee(array[index], index, array) === false) {
      break;
    }
  }

  return array;
}

module.exports = arrayEach;