array-intersect
v0.0.1
Published
[![array-intersect on Travis](https://img.shields.io/travis/callmecavs/array-intersect.svg?style=flat-square)](https://travis-ci.org/callmecavs/array-intersect) [![array-intersect on NPM](https://img.shields.io/npm/v/array-intersect.svg?style=flat-square)
Downloads
30,667
Readme
array-intersect
Install
$ npm i array-intersect --save
Use
Pass any number of arrays as arguments.
Expects that:
- Array items are unique (deduped)
- Array items are primitive types
import intersect from 'array-intersect'
const simple = intersect(
[1, 2, 3],
[2, 3, 4]
)
const complex = intersect(
[0, 1, 2, 3],
[1, 2, 3, 4],
[2, 3, 4, 5]
)
console.log(simple) // [2, 3]
console.log(complex) // [2, 3]
Browser Support
Requires support for ES5 Array Methods.
License
MIT. © 2018 Michael Cavalea