constant
_.constant(value)
# Ⓢ [Ⓣ][1] Ⓝ
Creates a function that returns value.
Since
2.4.0
Arguments
value(*): The value to return from the new function.
Returns
(Function): Returns the new constant function.
Example
var objects = _.times(_.constant({ 'a': 1 }), 2);
// => [{ 'a': 1 }, { 'a': 1 }]
// => true