Return the difference between two sets, or the symmetric difference between two sets.
const difference = require('@sets/difference')
console.log(difference(
new Set('hello'),
new Set('world'))
)) // "he"
console.log(difference.symmetric(
new Set('hello'),
new Set('world'))
)) // "hewrd"
$ npm install --save @sets/difference
difference(lhs, rhs) -> SetReturn the difference between the sets represented by lhs and rhs. The
resulting set will contain all elements from lhs that do not appear in rhs.
difference.symmetric(lhs, rhs) -> SetReturn the symmetric difference between the sets represented by lhs and rhs. The
resulting set will contain all elements from lhs that do not appear in rhs and
all elements from rhs that do not appear in lhs.
MIT