2b5fb16ef3ab7a8d0ddff5f73d3e562c7c71bb1d1090d38f9095ce360209f16f0e7cafd5060451d400096127f083ffeecbc92a0fa5bc25eb26ecbe06e01dd2 554 B

123456789101112131415161718192021
  1. /**
  2. * A specialized version of `_.map` for arrays without support for iteratee
  3. * shorthands.
  4. *
  5. * @private
  6. * @param {Array} [array] The array to iterate over.
  7. * @param {Function} iteratee The function invoked per iteration.
  8. * @returns {Array} Returns the new mapped array.
  9. */
  10. function arrayMap(array, iteratee) {
  11. var index = -1,
  12. length = array == null ? 0 : array.length,
  13. result = Array(length);
  14. while (++index < length) {
  15. result[index] = iteratee(array[index], index, array);
  16. }
  17. return result;
  18. }
  19. export default arrayMap;