Created
November 17, 2020 19:53
-
-
Save DoctorDerek/3110d41754b2413600f3a2798c2738fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE: instanceof won't work inside iframes | |
const myObject = {} | |
console.log(myObject instanceof Object) // true | |
console.log(myObject instanceof Array) // false | |
const myArray = [] | |
console.log(myArray instanceof Object) // true | |
console.log(myArray instanceof Array) // true | |
const myNull = null | |
console.log(myNull instanceof Object) // false | |
console.log(myNull instanceof Array) // false | |
const myDate = new Date() | |
console.log(myDate instanceof Object) // true | |
console.log(myDate instanceof Array) // false | |
console.log(myDate instanceof Date) // true | |
const myRegExp = /howdy/ | |
console.log(myRegExp instanceof Object) // true | |
console.log(myRegExp instanceof Array) // false | |
console.log(myRegExp instanceof RegExp) // true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment