Socket
Book a DemoInstallSign in
Socket

@sets/difference

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sets/difference

return the difference between two sets

latest
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

@sets/difference

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"

Installation

$ npm install --save @sets/difference

API

difference(lhs, rhs) -> Set

Return 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) -> Set

Return 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.

License

MIT

FAQs

Package last updated on 15 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts