mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 17:37: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;
|
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
|
* A specialized version of `_.filter` for arrays without support for callback
|
||||||
* shorthands or `this` binding.
|
* shorthands or `this` binding.
|
||||||
@@ -403,6 +383,26 @@
|
|||||||
return result;
|
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
|
* A specialized version of `_.reduce` for arrays without support for callback
|
||||||
* shorthands or `this` binding.
|
* shorthands or `this` binding.
|
||||||
|
|||||||
Reference in New Issue
Block a user