UNPKG

array-intersect

Version:

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

14 lines (11 loc) 378 B
var intersect = function intersect(first) { for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { rest[_key - 1] = arguments[_key]; } return rest.reduce(function (accum, current) { return accum.filter(function (x) { return current.indexOf(x) !== -1; }); }, first); }; export default intersect;