3 ms·
> I always struggle to remember if ‘filter’ keeps elements that match the condition or removes them if you had parameter names maybe it might help? `filter(wh
by andrekandre 17d ago
> I always struggle to remember if ‘filter’ keeps elements that match the condition or removes them
if you had parameter names maybe it might help?
`filter(where:)` like in swift...?
- mikebenfield 17d agoDoesn't seem to help the ambiguity to me.
- andrekandre 16d agomaybe its the verb? what about `exclude()` or `keep()`? in those cases its less ambiguous (to me anyways) that returning true means 'yes' to 'keep' or 'exclude', whereas saying yes or no to filter is like 'filter to exclude or include?' thats my take anyway