The constant function which returns the first passed value.
const fn = constant(4);expect(fn(3)).toStrictEqual(4);expect(fn("foo")).toStrictEqual(4); Copy
const fn = constant(4);expect(fn(3)).toStrictEqual(4);expect(fn("foo")).toStrictEqual(4);
The constant function which returns the first passed value.
Examples