1 2 3 4 5 6 7 8 9 10 11 | 18x 24x 2x 71x | import Iterator from '../iterators/Iterator'; import '../first'; Iterator.prototype.contains = function contains(value) { if (typeof value === 'undefined') { throw new Error('Missing value to compare with.'); } return !!this.first(item => Object.is(item, value)); }; |