tc39 / proposal-upsert

ECMAScript Proposal, specs, and reference implementation for Map.prototype.upsert
https://tc39.es/proposal-upsert/
MIT License
204 stars 14 forks source link

clarification on key ordering when updating #57

Closed runspired closed 1 month ago

runspired commented 1 month ago

since Map keeps track of key-insertion order, I feel this spec should define key-order semantics for update as there are two possible outcomes:

I suspect the obvious choice is to maintain the current key position, but that it would be best to be explicit about it.

dminor commented 1 month ago

We're going in a different direction with this proposal that no longer includes updating, but this is a valid point to consider if we revisit the update use case in the future.