Namespace: Basic:isA

Basic:isA

Source:

Methods

isA(value, type) → {Boolean}

Short form of "getType"-method with a more compact syntax. Can identify all types listed in getType.

Parameters:
Name Type Description
value *

variable to check the type of

type String

the name of the type to check for, has to be a standard JS-type, is case insensitive

Source:
See:
Returns:
target has type
Type
Boolean
Example
let stringBool = (isA(test, 'boolean') && test) ? 'true' : 'false';