MCPcopy Create free account
hub / github.com/RubyLouvre/anu / baseMap

Function baseMap

test/babel.js:28059–28067  ·  view source on GitHub ↗

* The base implementation of `_.map` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array.

(collection, iteratee)

Source from the content-addressed store, hash-verified

28057 * @returns {Array} Returns the new mapped array.
28058 */
28059 function baseMap(collection, iteratee) {
28060 var index = -1,
28061 result = isArrayLike(collection) ? Array(collection.length) : [];
28062
28063 baseEach(collection, function (value, key, collection) {
28064 result[++index] = iteratee(value, key, collection);
28065 });
28066 return result;
28067 }
28068
28069 module.exports = baseMap;
28070

Callers 1

baseOrderByFunction · 0.85

Calls 1

isArrayLikeFunction · 0.70

Tested by

no test coverage detected