Returns the provided value unchanged.
Useful as a default callback, placeholder function, or when working with higher-order functions that require an identity mapping.
The value to return.
The same value that was passed in.
identity(42); // 42identity("hello"); // "hello" Copy
identity(42); // 42identity("hello"); // "hello"
Returns the provided value unchanged.
Useful as a default callback, placeholder function, or when working with higher-order functions that require an identity mapping.