mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 07:17:50 +00:00
Change source order of arrayFilter and arrayMap.
This commit is contained in:
40
lodash.js
40
lodash.js
@@ -359,26 +359,6 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* A specialized version of `_.map` for arrays without support for callback
|
||||
* shorthands or `this` binding.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @returns {Array} Returns the new mapped array.
|
||||
*/
|
||||
function arrayMap(array, iteratee) {
|
||||
var index = -1,
|
||||
length = array.length,
|
||||
result = Array(length);
|
||||
|
||||
while (++index < length) {
|
||||
result[index] = iteratee(array[index], index, array);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* A specialized version of `_.filter` for arrays without support for callback
|
||||
* shorthands or `this` binding.
|
||||
@@ -403,6 +383,26 @@
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* A specialized version of `_.map` for arrays without support for callback
|
||||
* shorthands or `this` binding.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @returns {Array} Returns the new mapped array.
|
||||
*/
|
||||
function arrayMap(array, iteratee) {
|
||||
var index = -1,
|
||||
length = array.length,
|
||||
result = Array(length);
|
||||
|
||||
while (++index < length) {
|
||||
result[index] = iteratee(array[index], index, array);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* A specialized version of `_.reduce` for arrays without support for callback
|
||||
* shorthands or `this` binding.
|
||||
|
||||
Reference in New Issue
Block a user