array["foo"] = "bar"
is valid javascript. array["foo"] = "bar"
is valid javascript. array["at"] = "lunchtime";
Is also valid javascript... And will break functionality in this proposal!Browser makers start implementing the feature and releasing it in the development and beta versions of their browsers. Then if the users of the experimental features start noticing that webpage break, the proposal will get an update.
If I remember correctly, this exact thing happened to `Array.prototype.flatten` which got renamed to `Array.prototype.flat` after it was realized that the former broke a lot of legacy webpages (and after a long discussion of `Array.prototype.smoosh`[1])
1: https://developers.google.com/web/updates/2018/03/smooshgate
https://github.com/tc39/proposal-relative-indexing-method#we...
In Javascript, arrays are actually dictionaries. But not full dictionaries, rather just dictionaries that can have either a string or numeric key.
It's messy because an array in javascript isn't just "an array" it's this mismesh of features that are unexpected to a new-to-javascript developer.
Unexpected is the enemy of readable code.