2 ms·
Likely you'd like the modern class syntax then. You declaratively specific the "class" (it's just an Object under the hood, it's mostly sugar for prototypes) a
by abritinthebay 8y ago
Likely you'd like the modern class syntax then.
You declaratively specific the "class" (it's just an Object under the hood, it's mostly sugar for prototypes) and then you could just to instanceOf to test if it's your "type".
I mean in JS basically everything is an object so if you're constructing a "type" you're constructing an object no matter what.