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 |
Returns:
target has type
- Type
- Boolean
Example
let stringBool = (isA(test, 'boolean') && test) ? 'true' : 'false';