3 ms·
Most languages have one kind of "object" used for data and another kind used for instances of classes associated with OO programming. JavaScript traditionally u
by tmcw 6y ago
Most languages have one kind of "object" used for data and another kind used for instances of classes associated with OO programming. JavaScript traditionally uses one kind for both (traditionally, in that there is now an alternative, Map, but it's underused https://macwright.com/2017/03/13/maps-not-strictly-better.html https://macwright.com/2017/03/13/maps-not-strictly-better.ht... )
In other languages, the data kind of object - dicts in python, hashes in ruby - allows you to associate any key with any value. In JavaScript, the hybrid kind of object that's used for both, allows you to associate keys with values, but has some keys that are special, like __proto__, that override language constructs and cause chaos and vulnerabilities.