Files
alfresco-ng2-components/ng2-components/ng2-alfresco-documentslist/dist/node_modules/lodash/constant.js
Mario Romano 07807e7bc3 # add dist
2016-04-21 11:56:31 +01:00

25 lines
457 B
JavaScript

/**
* Creates a function that returns `value`.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Util
* @param {*} value The value to return from the new function.
* @returns {Function} Returns the new function.
* @example
*
* var object = { 'user': 'fred' };
* var getter = _.constant(object);
*
* getter() === object;
* // => true
*/
function constant(value) {
return function() {
return value;
};
}
module.exports = constant;