Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "utils/constructor-name/docs/types/index.d"

Index

Functions

Functions

Export assignment constructorName

  • constructorName(v: any): string
  • Determines the name of a value's constructor.

    Parameters

    • v: any

      input value

    Returns string

    name of a value's constructor

    Example

    var v = constructorName( 'a' );
    // returns 'String'

    Example

    var v = constructorName( 5 );
    // returns 'Number'

    Example

    var v = constructorName( null );
    // returns 'Null'

    Example

    var v = constructorName( undefined );
    // returns 'Undefined'

    Example

    var v = constructorName( function noop() {} );
    // returns 'Function'