These patterns are so useful in day to day work!
In the 'one loop two arrays' pattern for partitioning I like to emphasize what is the essential, minimal difference in each condition. In this case, it's really just 'what array do I append to?'
var target =
predicate(example) ? 1 : 0];
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.