Options
All
  • Public
  • Public/Protected
  • All
Menu

Module type

Index

References

Type aliases

Functions

References

Renames and re-exports type

Type aliases

TypeType: "Object" | "Number" | "Boolean" | "Date" | "String" | "Null" | "Array" | "RegExp" | "Function" | "Undefined"

Functions

  • Gives a single-word string description of the (native) type of a value, returning such answers as 'Object', 'Number', 'Array', or 'Null'. Does not attempt to distinguish user Object types any further, reporting them all as 'Object'.

    example
     type({}); //=> "Object"
    type(1); //=> "Number"
    type(false); //=> "Boolean"
    type('s'); //=> "String"
    type(null); //=> "Null"
    type([]); //=> "Array"
    type(/[A-z]/); //=> "RegExp"

    Parameters

    • x: any

      The value to test

    Returns TypeType

Generated using TypeDoc