@stdlib/utils-identity-function
v0.2.2
Published
Identity function.
Downloads
1,471
Readme
Identity Function
Identity function.
Installation
npm install @stdlib/utils-identity-function
Usage
var identity = require( '@stdlib/utils-identity-function' );
identity( x )
Returns x
.
var v = identity( 3.14 );
// returns 3.14
var input = [];
var output = identity( input );
var bool = ( input === output );
// returns true
Examples
var identity = require( '@stdlib/utils-identity-function' );
var v = identity( 3.14 );
// returns 3.14
v = identity( true );
// returns true
v = identity( null );
// returns null
v = identity( void 0 );
// returns undefined
v = identity();
// returns undefined
See Also
@stdlib/utils-constant-function
: constant function.
Notice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
License
See LICENSE.
Copyright
Copyright © 2016-2024. The Stdlib Authors.