Collection for next.
npm install -S @jswork/next-collection
api | params | description |
---|---|---|
union | - | Union collection. |
intersect | - | Collection intersection. |
diff | - | Collection difference. |
minus | - | Collection except other(minus). |
import NxCollection from '@jswork/next-collection';
const arr1 = [1, 2, 3]
const arr2 = [1, 5, 2, 6]
const col1 = nx.Collection.minus(arr1, arr2);
const col2 = nx.Collection.minus(arr2, arr1);
// result:
// [3]
// [5, 6]
Code released under the MIT license.