sequency
Version:
Functional sequences for processing iterable data in JavaScript
25 lines • 824 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.Unzip = void 0;
var Unzip = /** @class */ (function () {
function Unzip() {
}
/**
* Returns a pair of arrays where the first array contains all first values
* and the second array all second values from each input pair of the sequence.
*
* @returns {[Array<T> , Array<S>]}
*/
Unzip.prototype.unzip = function () {
var array1 = [];
var array2 = [];
for (var item = this.iterator.next(); !item.done; item = this.iterator.next()) {
var _a = item.value, first = _a[0], second = _a[1];
array1.push(first);
array2.push(second);
}
return [array1, array2];
};
return Unzip;
}());
exports.Unzip = Unzip;
//# sourceMappingURL=unzip.js.map