Skip to content

constant

Returns a function that always returns the same value.

ts
import { constant } from '@vielzeug/toolkit';

const alwaysFive = constant(5);
alwaysFive(); // 5