O'Reilly logo
  • Karl Giesing thinks this is interesting:

We’re not using instanceof anymore, because it’s confusingly pretending to have something to do with classes. Now, we just ask the (informally stated) question, “Are you a prototype of me?”


Cover of You Don't Know JS: this & Object Prototypes


Here are the two checks that are the most relevant: if (a instanceof SubType) { /* ... */ } // vs. if (SubTypeObject.isPrototypeOf(a)) { /* ... */} I have no idea why the author thinks the second is less confusing.