Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Index

Functions

Functions

Export assignment isSameValue

  • isSameValue(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 -0 and +0 as distinct and 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 = isSameValue( true, true );
    // returns true

    Example

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

    Example

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

    Example

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

    Example

    var bool = isSameValue( -0.0, 0.0 );
    // returns false

    Example

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

    Example

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