Returns the input value. This is a utility function that can be used as a default callback or placeholder when no transformation is needed. It simply returns the value passed to it.
const value = 42;const result = identity(value);console.log(result); // 42 Copy
const value = 42;const result = identity(value);console.log(result); // 42
Use identity from es-toolkit instead.
identity
es-toolkit
Returns the input value. This is a utility function that can be used as a default callback or placeholder when no transformation is needed. It simply returns the value passed to it.