first input value
second input value
boolean indicating whether two arguments are the same value
var bool = isSameValue( true, true );
// returns true
var bool = isSameValue( 3.14, 3.14 );
// returns true
var bool = isSameValue( {}, {} );
// returns false
var bool = isSameValue( -0.0, -0.0 );
// returns true
var bool = isSameValue( -0.0, 0.0 );
// returns false
var bool = isSameValue( NaN, NaN );
// returns true
var bool = isSameValue( [], [] );
// returns false
Tests if two arguments are the same value.
Notes
===
operator in that the function treats-0
and+0
as distinct andNaNs
as the same.