Hacker News new | ask | show | jobs
by HeavyFeather 1204 days ago
> focus more on improving the terrible JS web API

That's W3C’s job, not ECMA’s.

> Where are all the containers?

?

> Sorted sets/maps?

Sets and Maps are sorted (by insertion order)

> Why can't I even map an iterator?

It's coming, but someone will likely be exhausted by that addition. https://github.com/tc39/proposal-iterator-helpers

2 comments

By sorted sets/maps, I think they are referring to a binary-search-tree-backed implementation that is efficient for operations like find all keys between x and y, e.g. something like Java's SortedSet[1].

[1] https://docs.oracle.com/javase/7/docs/api/java/util/SortedSe...

> Sets and Maps are sorted (by insertion order)

That's not what a "sorted set" is. C++ and Rust provide sets (and maps) that sort based on an arbitrary comparison operator.

> ?

?

> but someone will likely be exhausted by that addition

I suppose. I guess it's one of those things that they really should have got right the first time. Like String.replaceAll(). I guess they will never add String.replaceAllSafe() - well just have to rely on linters to tell us that the API is terrible forever.