* A specialized version of `_.map` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array.
(array, iteratee)
| 115 | * @returns {Array} Returns the new mapped array. |
| 116 | */ |
| 117 | function arrayMap(array, iteratee) { |
| 118 | let index = -1; |
| 119 | |
| 120 | const length = array ? array.length : 0; |
| 121 | |
| 122 | const result = Array(length); |
| 123 | |
| 124 | while (++index < length) { |
| 125 | result[index] = iteratee(array[index], index, array); |
| 126 | } |
| 127 | return result; |
| 128 | } |
| 129 | |
| 130 | /** |
| 131 | * Converts an ASCII `string` to an array. |