UNPKG

augmented-array

Version:

Extends Array methods adding: - combine(array): Object - diff(array): Array - indexByKey(arrayOfObjects): objectOfObjects - intersect(array): Array - pluck(field): Array - range(elements): Array - range(begin, end): Array - subtract(array): Array

9 lines (8 loc) 257 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); if (!Array.prototype.intersect) { Array.prototype.intersect = function intersect(array) { return this .filter(element => array.includes(element)); }; }