javascript check if object instanceof code example
Example 1: js not instanceof
if ( !(obj instanceof Array) ) {
console.log('obj is not an Array')
}
Example 2: instance of
The instanceof keyword checks whether an object
is an instance of a specific class or an interface.
The instanceof keyword compares the
instance with type. The return value
is either true or false .