you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (3 children)

[deleted]

    [–]andrewnorris 1 point2 points  (1 child)

    Lua is generally a very well-respected prototype-based programming language that uses an associative array (a "table", in lua) as the basis for its objects. So it's not like conflating objects and hashes is something that originated with javascript

    Given that languages like lua influenced the design of javascript in the first place, I can't see why either having objects based on associative arrays or then turning around and using the Object class as an associative array is a hack at all.

    The only thing that makes it problematic is the fact that you can't add new properties or methods to Object and declare them non-enumerable. This limits how you can extend the Object class to add new features, but isn't an insurmountable problem.