Yeah! I'm the snarky cat named Meouzer
who does my best programming on browsers
but after taking the internet down
I gave a really big frown
and said that's what happens I'm smozered
Meouzer
See Symbol.toStringTag at MDN, which somehow just seems relevant since we actually use it.
User class is short for programmer defined class. The userType() function will type user classes, however it is slower than the type() function, which does not type user classes (as of yet). For a user class Baz, Symbol.toStringTag comes to the rescue in which by defining Symbol.toStringTag as getter property of a class instance x in the constructor, we can make both nativeType(x) and type(x) evaluate to "Baz".
There are two potential problems to ponder.
So nativeType(x) === "Baz" is definitive test on whether an element x is a class instance of Baz. type(x) === "Baz" is another definitive test.