I have one parent Map and want to divide it with some logic.
let m = Map();
let sub1 = m.filter((el) => el.isFiltered());
How can I get the rest of the Map? I know that I can invert condition inside filter, but I want to know if there is some method which is analogue to _.difference in underscore?
You can use groupBy to get both subsets with one iteration round:
Example on jsbin: http://jsbin.com/gavikufefi/edit?js,console