Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "assert/is-same-value-zero/docs/types/index.d"

Index

Functions

Functions

Export assignment isSameValueZero

  • isSameValueZero(a: any, b: any): boolean
  • Tests if two arguments are the same value.

    Notes

    • The function differs from the === operator in that the function treats NaNs as the same.

    Parameters

    • a: any

      first input value

    • b: any

      second input value

    Returns boolean

    boolean indicating whether two arguments are the same value

    Example

    var bool = isSameValueZero( true, true );
    // returns true

    Example

    var bool = isSameValueZero( 3.14, 3.14 );
    // returns true

    Example

    var bool = isSameValueZero( {}, {} );
    // returns false

    Example

    var bool = isSameValueZero( -0.0, -0.0 );
    // returns true

    Example

    var bool = isSameValueZero( -0.0, 0.0 );
    // returns true

    Example

    var bool = isSameValueZero( NaN, NaN );
    // returns true

    Example

    var bool = isSameValueZero( [], [] );
    // returns false