@@ -171,6 +171,7 @@ structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])
171171 - [ ` Symbol.metadata ` for decorators metadata proposal] ( #symbolmetadata-for-decorators-metadata-proposal )
172172 - [ Stage 2.7 proposals] ( #stage-27-proposals )
173173 - [ ` Iterator ` sequencing] ( #iterator-sequencing )
174+ - [ Joint iteration] ( #joint-iteration )
174175 - [ ` Map ` upsert] ( #map-upsert )
175176 - [ Stage 2 proposals] ( #stage-2-proposals )
176177 - [ ` AsyncIterator ` helpers] ( #asynciterator-helpers )
@@ -2766,6 +2767,57 @@ Iterator.concat([0, 1].values(), [2, 3], function * () {
27662767}()).toArray (); // => [0, 1, 2, 3, 4, 5]
27672768```
27682769
2770+ ##### [ Joint iteration] ( https://github.com/tc39/proposal-joint-iteration ) [ ⬆] ( #index )
2771+ Modules [ esnext.iterator.zip] ( https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.iterator.zip.js ) , [ esnext.iterator.zip-keyed] ( https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.iterator.zip-keyed.js )
2772+ ``` ts
2773+ class Iterator {
2774+ zip<T extends readonly Iterable <unknown >[]>(
2775+ iterables : T ,
2776+ options ? : {
2777+ mode? : ' shortest' | ' longest' | ' strict' ;
2778+ padding? : { [K in keyof T ]? : T [K ] extends Iterable <infer U > ? U : never };
2779+ }
2780+ ): IterableIterator <{ [K in keyof T ]: T [K ] extends Iterable <infer U > ? U : never }>;
2781+ zipKeyed<K extends PropertyKey , V extends Record <K , Iterable <unknown >>>(
2782+ iterables : V ,
2783+ options ? : {
2784+ mode? : ' shortest' | ' longest' | ' strict' ;
2785+ padding? : { [P in keyof V ]? : V [P ] extends Iterable <infer U > ? U : never };
2786+ }
2787+ ): IterableIterator <{ [P in keyof V ]: V [P ] extends Iterable <infer U > ? U : never }>;
2788+ }
2789+ ```
2790+ [ * CommonJS entry points:* ] ( #commonjs-api )
2791+ ```
2792+ core-js/proposals/joint-iteration
2793+ core-js(-pure)/full/iterator/zip
2794+ core-js(-pure)/full/iterator/zip-keyed
2795+ ```
2796+ [ * Example* ] ( https://tinyurl.com/vutnf2nu ) :
2797+ ``` js
2798+ Iterator .zip ([
2799+ [0 , 1 , 2 ],
2800+ [3 , 4 , 5 ],
2801+ ]).toArray (); // => [[0, 3], [1, 4], [2, 5]]
2802+
2803+ Iterator .zipKeyed ({
2804+ a: [0 , 1 , 2 ],
2805+ b: [3 , 4 , 5 , 6 ],
2806+ c: [7 , 8 , 9 ],
2807+ }, {
2808+ mode: ' longest' ,
2809+ padding: { c: 10 },
2810+ }).toArray ();
2811+ /*
2812+ [
2813+ { a: 0, b: 3, c: 7 },
2814+ { a: 1, b: 4, c: 8 },
2815+ { a: 2, b: 5, c: 9 },
2816+ { a: undefined, b: 6, c: 10 },
2817+ ];
2818+ */
2819+ ```
2820+
27692821##### [ ` Map ` upsert] ( https://github.com/thumbsupep/proposal-upsert ) [ ⬆] ( #index )
27702822Modules [ ` esnext.map.get-or-insert ` ] ( https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.map.get-or-insert.js ) , [ ` esnext.map.get-or-insert-computed ` ] ( https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.map.get-or-insert-computed.js ) , [ ` esnext.weak-map.get-or-insert ` ] ( https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.weak-map.get-or-insert.js ) and [ ` esnext.weak-map.get-or-insert-computed ` ] ( https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.weak-map.get-or-insert-computed.js )
27712823``` ts
0 commit comments