swagger-api-generator
Version:
generate api function by swagger
22 lines (18 loc) • 468 B
JavaScript
/**
* A specialized version of `forEach` for arrays.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns `array`.
*/
export function forEach(array, iteratee) {
let index = -1
const length = array == null ? 0 : array.length
while (++index < length) {
if (iteratee(array[index], index, array) === false) {
break
}
}
return array
}