From c46c700f7c8f41fbbcf2d2ec2893f1f683f21bfb Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 14 Oct 2014 20:37:20 -0700 Subject: [PATCH] Change source order of `arrayFilter` and `arrayMap`. --- lodash.js | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/lodash.js b/lodash.js index aa6593eee..df9e4f908 100644 --- a/lodash.js +++ b/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.