MCPcopy
hub / github.com/lodash/lodash / constant

Function constant

lodash.js:15514–15518  ·  view source on GitHub ↗

* 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 constant function. * @example * * var objects = _

(value)

Source from the content-addressed store, hash-verified

15512 * // => true
15513 */
15514 function constant(value) {
15515 return function() {
15516 return value;
15517 };
15518 }
15519
15520 /**
15521 * Checks `value` to determine whether a default value should be returned in

Callers 2

lodash.jsFile · 0.85
test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected