Map/Set.prototype.size is O(n)

Oriol _ oriol-bugzilla at
Wed Mar 29 15:31:58 UTC 2017

Not only `size`. All `get`, `set`, `has`, etc. algorithms in the spec are O(n).

But as explained in,

> Map object must be implemented using either hash tables or other mechanisms that, on average,
> provide access times that are sublinear on the number of elements in the collection.
> The data structures used in this Map objects specification is only intended to describe the required
> observable semantics of Map objects. It is not intended to be a viable implementation model.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list