Comment Comment by TimothyBJacobs A common API is something like lodash's `partition` so you don't have to loop over the same Array multiple times: https://lodash.com/docs/#partition parent TimothyBJacobs 4 years ago