japt
japt copied to clipboard
Filtering Permutations & Combinations
On a recent challenge I needed to get the combinations of an array and then filter them, which got me thinking that an additional, optional function parameter for à
& á
to apply the filter directly, without the need for f
, would be handy. And, in most cases, would save 2 bytes.
I had also considered that maybe making that function parameter a map rather than a filter might be more useful. Apart from my immediate use-case, I couldn't come up with an argument for one over the other but, seeing as the n
parameter of those methods is also a filter, of sorts, a filter does probably make most sense.