Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Index

Functions

Functions

Export assignment isSameType

  • isSameType(a: any, b: any): boolean
  • Tests if two arguments have the same type.

    Notes

    • The function uses the typeof operator to test for the same type.

    Parameters

    • a: any

      first input value

    • b: any

      second input value

    Returns boolean

    boolean indicating whether two arguments have the same type

    Example

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

    Example

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

    Example

    var bool = isSameType( {}, [] );
    // returns true

    Example

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

    Example

    var bool = isSameType( 0.0, '0.0' );
    // returns false