0.0.1 • Published 3 years ago

@shibe23/set-operations v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

set-operations

Lightweight Set Operation Library for Objects in Array.

install

npm install @shibe23/set-operations

Usage

const a = [{name: "Jack", age: 10}, {name: "Tom", age: 38}];
const b = [{name: "Bob", age: 23}, {name: "Tom", age: 38}, {name: "Nancy", age: 29}];

difference()

difference(a, b, "name")

// [{name: "Bob",age: 23}, {name: "Nancy", age: 29}];

intersection()

intersection(a, b, "name")

// [{name: "Tom",age: 38}];