News for hackers. Stuff that matters.
Re:How an Anti-TypeScript “JavaScript developer” like me bec... by recursive on Tuesday March 02, 2021 @07:24PM (#26323155)
I use BigInt often, but you can't (for example) do most substring operations with it, even though floating point indexes make no sense.

Map goes part of the way to what I want. But I really want to control which objects are considered equivalent keys, rather than being limited to reference equality.

Re:How an Anti-TypeScript “JavaScript developer” like me bec... by WorldMaker on Wednesday March 03, 2021 @01:34PM (#26332528)
There's a Stage 2 proposal before TC-39 to add immutable Record and Tuple types [1] which would be structurally compared and perfect for complex Map keys.

It's also easy enough to find or write quick simple Map wrappers that use a hash function on an object as keys when provided (either piggy-backing on the existing Object.prototype.valueOf, which always exists on every object and easily falls back to the reference-based current behavior, and expecting classes to have custom overrides for that, or using a Symbol named function of their own to avoid polluting own-property-keys/name clashes with other libraries).

[1] https://github.com/tc39/proposal-record-tuple