From c1eaa90c2bc6d744f79cd8911938f20ac7b519d8 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 17 Jun 2014 10:30:51 -0700 Subject: [PATCH] Move `callback` above `constant`. --- lodash.js | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/lodash.js b/lodash.js index 196d6cf7b..d69d1805d 100644 --- a/lodash.js +++ b/lodash.js @@ -8063,27 +8063,6 @@ /*--------------------------------------------------------------------------*/ - /** - * Creates a function that returns `value`. - * - * @static - * @memberOf _ - * @category Utilities - * @param {*} value The value to return from the new function. - * @returns {Function} Returns the new function. - * @example - * - * var object = { 'name': 'fred' }; - * var getter = _.constant(object); - * getter() === object; - * // => true - */ - function constant(value) { - return function() { - return value; - }; - } - /** * Creates a function bound to an optional `thisArg`. If `func` is a property * name the created callback returns the property value for a given element. @@ -8130,6 +8109,27 @@ return type == 'object' ? matches(func) : property(func); } + /** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @category Utilities + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new function. + * @example + * + * var object = { 'name': 'fred' }; + * var getter = _.constant(object); + * getter() === object; + * // => true + */ + function constant(value) { + return function() { + return value; + }; + } + /** * This method returns the first argument provided to it. *