3 ms·
I couldn’t immediately see any proposals for list/set/object comprehensions at https://github.com/tc39/proposals https://github.com/tc39/proposals, are there an
by Myrmornis 9y ago
I couldn’t immediately see any proposals for list/set/object comprehensions at https://github.com/tc39/proposals https://github.com/tc39/proposals, are there any?
- masklinn 9y agoUnlikely. Mozilla had extensions which they submitted for ES6 IIRC (lists and generators) but it seems the tc39 preferred going with HoFs instead.
- Myrmornis 9y agoThanks. On the face of it it seems a bit of a shame to me. My experience writing python daily (since before dict and set comprehensions were introduced) is that the comprehension syntax is used extremely commonly in a large codebase and that the way that you can specify both the transformation and the filtering in a single comprehension is much more readable than composing a map and a filter.
- turdnagel 9y agoI don't think those are happening, but how about basic set arithmetic? The fact that you can't do difference / union / intersection using the standard library is frustrating.
- pitaj 9y agoThere's a proposal for that.
- epmatsw 9y agoTwo of them now. One to add Set-specific methods, and another to port the usual Array.prototype methods over to Set and Maps. Can't wait! https://github.com/tc39/set-methods https://github.com/tc39/set-methods https://github.com/tc39/collection-methods https://github.com/tc39/collection-methods