Initial commit
[yaffs-website] / node_modules / grunt-contrib-watch / node_modules / lodash / utility / constant.js
1 /**
2  * Creates a function that returns `value`.
3  *
4  * @static
5  * @memberOf _
6  * @category Utility
7  * @param {*} value The value to return from the new function.
8  * @returns {Function} Returns the new function.
9  * @example
10  *
11  * var object = { 'user': 'fred' };
12  * var getter = _.constant(object);
13  *
14  * getter() === object;
15  * // => true
16  */
17 function constant(value) {
18   return function() {
19     return value;
20   };
21 }
22
23 module.exports = constant;