Skip to content

identity() function ​

Returns the same value as the given argument.

Signature:

typescript
declare function identity<T>(a: T): T;

Example ​

ts
identity(5); // 5

Open Source Code

Released under the Apache-2.0 License.