@@ -127,11 +127,11 @@ queueMicrotask(() => console.log('called as microtask'));
127
127
- [ Stage 3 proposals] ( #stage-3-proposals )
128
128
- [ ` Array ` grouping] ( #array-grouping )
129
129
- [ ` Array ` find from last] ( #array-find-from-last )
130
+ - [ Change ` Array ` by copy] ( #change-array-by-copy )
130
131
- [ Stage 2 proposals] ( #stage-2-proposals )
131
132
- [ ` Iterator ` helpers] ( #iterator-helpers )
132
133
- [ New ` Set ` methods] ( #new-set-methods )
133
134
- [ ` Map.prototype.emplace ` ] ( #mapprototypeemplace )
134
- - [ Change ` Array ` by copy] ( #change-array-by-copy )
135
135
- [ ` Array.fromAsync ` ] ( #arrayfromasync )
136
136
- [ ` Array.isTemplateObject ` ] ( #arrayistemplateobject )
137
137
- [ ` Symbol.{ asyncDispose, dispose } ` for ` using ` statement] ( #symbol-asyncdispose-dispose--for-using-statement )
@@ -2115,6 +2115,53 @@ core-js/actual|features/typed-array/find-last-index
2115
2115
[1, 2, 3, 4].findLast(it => it % 2); // => 3
2116
2116
[1, 2, 3, 4].findLastIndex(it => it % 2); // => 2
2117
2117
` ` ` `
2118
+ ##### [Change ` Array ` by copy](https://github.com/tc39/proposal-change-array-by-copy)[⬆](#index)
2119
+ Modules [`esnext.array.to-reversed`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.to-reversed.js), [`esnext.array.to-sorted`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.to-sorted.js), [`esnext.array.to-spliced`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.to-spliced.js), [`esnext.array.with`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.with.js), [`esnext.typed-array.to-reversed`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.typed-array.to-reversed.js), [`esnext.typed-array.to-sorted`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.typed-array.to-sorted.js), [`esnext.typed-array.to-spliced`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.typed-array.to-spliced.js), [`esnext.typed-array.with`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.typed-array.with.js).
2120
+ ` ` ` js
2121
+ class Array {
2122
+ toReversed (): Array < mixed> ;
2123
+ toSpliced (start?: number, deleteCount?: number, ... items: Array < mixed> ): Array < mixed> ;
2124
+ toSorted (comparefn?: (a : any , b : any ) => number): Array < mixed> ;
2125
+ with (index: includes, value: any): Array < mixed> ;
2126
+ }
2127
+
2128
+ class % TypedArray% {
2129
+ toReversed (): % TypedArray% ;
2130
+ toSpliced (start?: number, deleteCount?: number, ... items: % TypedArray% ): % TypedArray% ;
2131
+ toSorted (comparefn?: (a : any , b : any ) => number): % TypedArray% ;
2132
+ with (index: includes, value: any): % TypedArray% ;
2133
+ }
2134
+ ` ` `
2135
+ [*CommonJS entry points:*](#commonjs-api)
2136
+ ` ` `
2137
+ core- js/ proposals/ change- array- by- copy
2138
+ core- js (- pure)/ actual| features/ array (/ virtual)/ to- reversed
2139
+ core- js (- pure)/ actual| features/ array (/ virtual)/ to- sorted
2140
+ core- js (- pure)/ actual| features/ array (/ virtual)/ to- spliced
2141
+ core- js (- pure)/ actual| features/ array (/ virtual)/ with
2142
+ core- js/ actual| features/ typed- array/ to- reversed
2143
+ core- js/ actual| features/ typed- array/ to- sorted
2144
+ core- js/ actual| features/ typed- array/ to- spliced
2145
+ core- js/ actual| features/ typed- array/ with
2146
+ ` ` `
2147
+ [*Examples*](t.ly/wcvY):
2148
+ ` ` ` js
2149
+ const sequence = [1 , 2 , 3 ];
2150
+ sequence .toReversed (); // => [3, 2, 1]
2151
+ sequence; // => [1, 2, 3]
2152
+
2153
+ const array = [1 , 2 , 3 , 4 ];
2154
+ array .toSpliced (1 , 2 , 5 , 6 , 7 ); // => [1, 5, 6, 7, 4]
2155
+ array; // => [1, 2, 3, 4]
2156
+
2157
+ const outOfOrder = [3 , 1 , 2 ];
2158
+ outOfOrder .toSorted (); // => [1, 2, 3]
2159
+ outOfOrder; // => [3, 1, 2]
2160
+
2161
+ const correctionNeeded = [1 , 1 , 3 ];
2162
+ correctionNeeded .with (1 , 2 ); // => [1, 2, 3]
2163
+ correctionNeeded; // => [1, 1, 3]
2164
+ ` ` ` `
2118
2165
2119
2166
#### Stage 2 proposals[⬆](#index)
2120
2167
[* CommonJS entry points: * ](#commonjs- api)
@@ -2288,53 +2335,6 @@ map.emplace('b', { update: it => it ** 2, insert: () => 3}); // => 3
2288
2335
2289
2336
console .log (map); // => Map { 'a': 4, 'b': 3 }
2290
2337
` ` `
2291
- ##### [Change ` Array ` by copy](https://github.com/tc39/proposal-change-array-by-copy)[⬆](#index)
2292
- Modules [`esnext.array.to-reversed`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.to-reversed.js), [`esnext.array.to-sorted`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.to-sorted.js), [`esnext.array.to-spliced`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.to-spliced.js), [`esnext.array.with`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.with.js), [`esnext.typed-array.to-reversed`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.typed-array.to-reversed.js), [`esnext.typed-array.to-sorted`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.typed-array.to-sorted.js), [`esnext.typed-array.to-spliced`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.typed-array.to-spliced.js), [`esnext.typed-array.with`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.typed-array.with.js).
2293
- ` ` ` js
2294
- class Array {
2295
- toReversed (): Array < mixed> ;
2296
- toSpliced (start?: number, deleteCount?: number, ... items: Array < mixed> ): Array < mixed> ;
2297
- toSorted (comparefn?: (a : any , b : any ) => number): Array < mixed> ;
2298
- with (index: includes, value: any): Array < mixed> ;
2299
- }
2300
-
2301
- class % TypedArray% {
2302
- toReversed (): % TypedArray% ;
2303
- toSpliced (start?: number, deleteCount?: number, ... items: % TypedArray% ): % TypedArray% ;
2304
- toSorted (comparefn?: (a : any , b : any ) => number): % TypedArray% ;
2305
- with (index: includes, value: any): % TypedArray% ;
2306
- }
2307
- ` ` `
2308
- [*CommonJS entry points:*](#commonjs-api)
2309
- ` ` `
2310
- core- js/ proposals/ change- array- by- copy
2311
- core- js (- pure)/ features/ array (/ virtual)/ to- reversed
2312
- core- js (- pure)/ features/ array (/ virtual)/ to- sorted
2313
- core- js (- pure)/ features/ array (/ virtual)/ to- spliced
2314
- core- js (- pure)/ features/ array (/ virtual)/ with
2315
- core- js/ features/ typed- array/ to- reversed
2316
- core- js/ features/ typed- array/ to- sorted
2317
- core- js/ features/ typed- array/ to- spliced
2318
- core- js/ features/ typed- array/ with
2319
- ` ` `
2320
- [*Examples*](t.ly/wcvY):
2321
- ` ` ` js
2322
- const sequence = [1 , 2 , 3 ];
2323
- sequence .toReversed (); // => [3, 2, 1]
2324
- sequence; // => [1, 2, 3]
2325
-
2326
- const array = [1 , 2 , 3 , 4 ];
2327
- array .toSpliced (1 , 2 , 5 , 6 , 7 ); // => [1, 5, 6, 7, 4]
2328
- array; // => [1, 2, 3, 4]
2329
-
2330
- const outOfOrder = [3 , 1 , 2 ];
2331
- outOfOrder .toSorted (); // => [1, 2, 3]
2332
- outOfOrder; // => [3, 1, 2]
2333
-
2334
- const correctionNeeded = [1 , 1 , 3 ];
2335
- correctionNeeded .with (1 , 2 ); // => [1, 2, 3]
2336
- correctionNeeded; // => [1, 1, 3]
2337
- ` ` ` `
2338
2338
##### [` Array .fromAsync ` ](https://github.com/tc39/proposal-array-from-async)[⬆](#index)
2339
2339
Modules [` esnext .array .from - async ` ](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.from-async.js).
2340
2340
` ` ` js
0 commit comments