Change source order of arrayFilter and arrayMap.

This commit is contained in:
John-David Dalton
2014-10-14 20:37:20 -07:00
parent 2a2de2efdc
commit c46c700f7c

View File

@@ -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.