Open utterances-bot opened 3 years ago
Quiz: What is the built-in constructor for which instanceof for any object returns true?
Default constructor
Quiz: What is the built-in constructor for which instanceof for any object returns true?
Default constructor
Nope. :)
new Boolean() instanceof Object // true new String() instanceof Object // true new Number() instanceof Object // true Object(Symbol()) instanceof Object // true ;) new Date() instanceof Object // true [] instanceof Object // true (() => {}) instanceof Object // true
new Boolean() instanceof Object // true new String() instanceof Object // true new Number() instanceof Object // true Object(Symbol()) instanceof Object // true ;) new Date() instanceof Object // true [] instanceof Object // true (() => {}) instanceof Object // true
Exactly!
Type checking in JavaScript: typeof and instanceof operators
How to perform type checking in JavaScript using typeof and instanceof operators.
https://dmitripavlutin.com/javascript-typeof-instanceof/