1 2 3 4 5 6 7 8 9 10 11 | 21x 94x 36x 58x | import Iterator from '../iterators/Iterator'; import '../where'; Iterator.prototype.first = function first(condition) { if (condition) { return this.where(condition).first(); } else { return this[Symbol.iterator]().next().value; } }; |