intersection-of

1.3.0 • Public • Published

intersection-of

CircleCI NPM Downloads node License MIT

Find unique common elements among given arrays

Highlights

  • Super Fast

  • Memoized

  • Written in Typescript

  • Async and Sync methods

  • Returns Promise

Usage

Get an array of common unique values that are included in all given arrays

 
// async
 
const { intersectionOf } = require('intersection-of');
 
intersectionOf([1,2,2,3,4], [2,3,6,7])
.then((result) => {
  console.log(result); // [2,3]
});
 
 
// sync
const { intersectionOfSync }  = require('intersection-of');
 
let result = intersectionOfSync([1,2,2,3,4], [2,3,6,7]);
console.log(result) // [2,3]
 

License

MIT © Nivrith Mandayam Gomatam

Package Sidebar

Install

npm i intersection-of

Weekly Downloads

3

Version

1.3.0

License

MIT

Unpacked Size

13.4 kB

Total Files

10

Last publish

Collaborators

  • nivrith