3 ms·
> ES6 has classes To clarify, I miss having an object model that allows customisation of hashing, equality etc > ES6 has a Map Thanks for this; I'll check it
by alexchamberlain 6y ago
> ES6 has classes
To clarify, I miss having an object model that allows customisation of hashing, equality etc
> ES6 has a Map
Thanks for this; I'll check it out. One simple example of a key that is hard to use strings with is a composite key of 2 strings. OK, you could concatenate them using a character you know won't be used in either string, but what if it's user input? The code is then littered with in/out concatenation/splitting my this extra character etc. (And that's the simple case without other types etc.) It's much easier to have a clear way to customise the hash function IMHO.