proposal-array-filtering
proposal-array-filtering copied to clipboard
A proposal to make filtering arrays easier
In the presentation, I see the new name, but in the proposal repo, I don't see any mentioning of that. So, it's changed?
### `select` While there are some languages where term `select` is synonymous with ECMAScript's `filter` (i.e. Ruby), there are other languages where the term `select` is synonymous with ECMAScript's `map`:...
Sure, methods from this proposal should have equal on `%TypedArray%`. The question: how should work `%TypedArray%.prototype.groupBy`?
As all ES6+ methods, those methods should be added to `Array.prototype[@@unscopables]`. It should be added to the spec draft.
I meant to find the tuples with a difference, but wrote it backwards again! ```js $$('head meta') .map(m => [m.content === m.getAttribute('content'), m.content, m.getAttribute('content')]) .filter(t => t[0]) // should be...
With `flatMap` added with `flat` to reduce iterations and allocations, it would be nice to have an accompanying `filterMap` method as well. I often find filter and map used together....
https://twitter.com/alephnaught2tog/status/1225223237216481285 https://twitter.com/alephnaught2tog/status/1225225894458949632 https://twitter.com/alephnaught2tog/status/1225226418898063360
| Underscore Function | Count | Percentage vs filter | |---------------------|---------|----------------------| | _.filter | 427,420 | | | _.select | 8,743 | 2% | | _.reject | 64,018 | 15%...
I think it'd be great if, prior to Stage 2 (or at least Stage 3), this could be prototyped as an independent package on npm, so we can get some...