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

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