identity es-toolkit
Returns the input value as is.
Usage
identity(value)
Use identity when you want to return a value without modifying it.
This is useful as a default value for functions passed as arguments. It's commonly used to return the value itself in array map or filter operations, or as a placeholder in functional programming.
Parameters
valueTrequired
The value to return.
Returns
Returns the input value as is.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.