4 ms·
Just genuinely curious, as I assume it's some bit of Javascript weirdness I don't know, but why the tostring rigmarole over "obj instanceof Array"
by dyselon 14y ago
Just genuinely curious, as I assume it's some bit of Javascript weirdness I don't know, but why the tostring rigmarole over "obj instanceof Array"
- prodigal_erik 14y agoThat's unreliable for client-side work because each frame has its own Array.prototype object which disavows instances that were created by code from different frames. It's a lot like Java classloaders, where if you aren't careful you can end up with several distinct and incompatible classes with identical names and (often) bytecode.