Package Exports
- @stdlib/assert-is-strict-equal
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@stdlib/assert-is-strict-equal) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
isStrictEqual
Test if two arguments are strictly equal.
Installation
npm install @stdlib/assert-is-strict-equalUsage
var isStrictEqual = require( '@stdlib/assert-is-strict-equal' );isStrictEqual( a, b )
Tests if two arguments a and b are strictly equal.
var bool = isStrictEqual( false, false );
// returns true
bool = isStrictEqual( '', '' );
// returns true
bool = isStrictEqual( {}, {} );
// returns false
bool = isStrictEqual( NaN, NaN );
// returns falseIn contrast to the strict equality operator ===, the function distinguishes between +0 and -0.
var bool = ( 0.0 === -0.0 );
// returns true
bool = isStrictEqual( 0.0, -0.0 );
// returns false
bool = isStrictEqual( -0.0, -0.0 );
// returns trueExamples
var isStrictEqual = require( '@stdlib/assert-is-strict-equal' );
var bool = isStrictEqual( true, true );
// returns true
bool = isStrictEqual( true, false );
// returns false
bool = isStrictEqual( 'beep', 'beep' );
// returns true
bool = isStrictEqual( 3.14, 3.14 );
// returns true
bool = isStrictEqual( null, null );
// returns true
bool = isStrictEqual( 0.0, 0.0 );
// returns true
bool = isStrictEqual( -0.0, 0.0 );
// returns false
bool = isStrictEqual( NaN, NaN );
// returns false
bool = isStrictEqual( {}, {} );
// returns false
bool = isStrictEqual( [], [] );
// returns false
bool = isStrictEqual( isStrictEqual, isStrictEqual );
// returns trueNotice
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.
License
See LICENSE.
Copyright
Copyright © 2016-2021. The Stdlib Authors.