Just wondering if it's possible to use an array function (like filter) to return both the negative and the positive outcomes of the statement at the same time using destructuring.
Something like the following:
let {truthys, falsys} = arr.filter(a => {
return //magical statement that returns truthy's and falsy's?
});
instead of:
let truthys = arr.filter(item => item.isTruthy);
let falsys = arr.filter(item => !item.isTruthy);
So something of a shorthand-way of doing the latter. Can't seem to find anything about this anywhere so it might not be possible at all. Thanks!