2015-01-10 12:55:03 -08:00
|
|
|
/**
|
2015-09-17 17:52:09 -07:00
|
|
|
* A specialized version of `_.forEach` for arrays without support for
|
|
|
|
|
* iteratee shorthands.
|
2015-01-10 12:55:03 -08:00
|
|
|
*
|
|
|
|
|
* @private
|
2016-05-18 16:00:35 -07:00
|
|
|
* @param {Array} [array] The array to iterate over.
|
2015-01-10 12:55:03 -08:00
|
|
|
* @param {Function} iteratee The function invoked per iteration.
|
|
|
|
|
* @returns {Array} Returns `array`.
|
|
|
|
|
*/
|
|
|
|
|
function arrayEach(array, iteratee) {
|
|
|
|
|
var index = -1,
|
2016-10-30 20:08:19 -07:00
|
|
|
length = array == null ? 0 : array.length;
|
2015-01-10 12:55:03 -08:00
|
|
|
|
|
|
|
|
while (++index < length) {
|
|
|
|
|
if (iteratee(array[index], index, array) === false) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return array;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default arrayEach;
|