Returns the value passed into the function.
npm install @identity-js/identity@identity-js/identitybash
npm install @identity-js/identity
`
🚀 Usage
The function accepts a single argument of any type and returns that argument unchanged.
$3
`javascript
const identity = require("@identity-js/identity");
`
$3
| Input Type | Code | Output |
| :--- | :--- | :--- |
| Number | identity(42) | 42 |
| String | identity('hello') | 'hello' |
| Object | const obj = {a: 1}; identity(obj) | // returns the same object reference: {a: 1} |
| Null | identity(null) | null |
✅ Testing
Tests are written using Mocha.
$3
Clone this repository, cd into packages/identity and install dependencies and dev-dependencies.
$3
Execute the test suite:
`
npm test
`
This will execute the tests to ensure the function works correctly across various data types (numbers, strings, objects, booleans, null, and undefined`).