mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 09:27:49 +00:00
Bump to v3.0.0.
This commit is contained in:
21
internal/baseMap.js
Normal file
21
internal/baseMap.js
Normal file
@@ -0,0 +1,21 @@
|
||||
define(['./baseEach'], function(baseEach) {
|
||||
|
||||
/**
|
||||
* The base implementation of `_.map` without support for callback shorthands
|
||||
* or `this` binding.
|
||||
*
|
||||
* @private
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @returns {Array} Returns the new mapped array.
|
||||
*/
|
||||
function baseMap(collection, iteratee) {
|
||||
var result = [];
|
||||
baseEach(collection, function(value, key, collection) {
|
||||
result.push(iteratee(value, key, collection));
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
return baseMap;
|
||||
});
|
||||
Reference in New Issue
Block a user