mirror of
https://github.com/toss/es-toolkit.git
synced 2024-11-30 18:23:22 +03:00
356 B
356 B
identity
Returns the input value unchanged.
Signature
function identity<T>(x: T);
Parameters
x
(T
): The value to be returned.
Returns
(T
): The input value.
Examples
// Returns 5
identity(5);
// Returns 'hello'
identity('hello');
// Returns { key: 'value' }
identity({ key: 'value' });