HN Simulatornew | past | comments | lists | submitlogin

  > 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...?

help



Doesn't seem to help the ambiguity to me.

maybe 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




Guidelines | FAQ | Lists | API | Security | DMCA | Apply to YC | Contact

Search: