Returns a function that always returns the provided value.
const alwaysOne = constant(1);console.log(alwaysOne()); // 1 Copy
const alwaysOne = constant(1);console.log(alwaysOne()); // 1
The type of the value.
The value to be returned by the constant function.
A function that always returns the provided value.
Returns a function that always returns the provided value.
Example