Comment by int_19h
1 year ago
It's even the most basic stuff. For example, as of today, there's no way to have an associative array in JS for which keys are composite types, because key equality is not customizable, and all objects use reference equality by default. For some cases you can stringify the key, but in the most general case (e.g. when you need to key on two object references), the only way to do that is to nest maps, which is slow, verbose, and error-prone.
(Tuples are coming to JS and will solve this particular issue, but it's embarrassing to have to deal with such stuff in 2024. Neither Python nor Ruby ever had this problem.)
No comments yet
Contribute on Hacker News ↗