Conversation

Replying to and
They added Map as a proper key-value data structure so it's a good idea to ban using objects as map data structure now, just like banning any usage of `var` (using only let/const) with "use strict" to prevent implicit usage of that nonsense broken form of scoping with hoisting.
1
I don't think it's reasonable to blame Map for objects implementing equality as reference equality. It would be worse if it deviated from the standard definition of equality in the language. Arrays and objects are what need to be fixed, not Map using `===` (it doesn't use `==`).
1
1
Map doesn't rule out introducing a way for objects to define equality and a hash function in the future like other languages. The initial implementation didn't need to be tied to other major new features. I think they're doing a great job with the terrible base they were given.
2
Replying to
But if arrays and objects are effectively off the cards as keys, then it's basically a very, very marginally improved object dictionary. It's yet another thing added that screws over beginners and leaves a nice fat landmine in the codebase for skilled developers.
1
Show replies