Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

array-intersect

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-intersect

[![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)

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.3K
increased by6.98%
Maintainers
1
Weekly downloads
 
Created
Source

array-intersect

array-intersect on Travis array-intersect on NPM array-intersect Downloads on NPM Standard JavaScript Style

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

Keywords

FAQs

Package last updated on 06 Aug 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc