Skip to main content

identity

A function that returns the value passed as an argument as-is.


Code​

🔗 View source code


Interface​

typescript
const identity: <T>(value: T) => T;

Usage​

typescript
import { identity } from '@modern-kit/utils';

identity(1); // 1
identity('foo'); // 'foo'
identity([]); // []