time-to-botec/squiggle/node_modules/@stdlib/utils/identity-function/README.md
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00

1.4 KiB

Identity Function

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