MCPcopy Create free account
hub / github.com/dunky11/react-saas-template / arrayMap

Function arrayMap

src/shared/functions/toArray.js:117–128  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

115 * @returns {Array} Returns the new mapped array.
116 */
117function 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.

Callers 1

baseValuesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected