3 ms·
It's called a null-prototype object: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects https://deve
by edflsafoiewq 3y ago
It's called a null-prototype object: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
They're "usually used as a cheap substitute for maps": the lack of prototype prevents the object from being polluted by keys that morally shouldn't be there, like toString, etc.