You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Change Array by Copy" is a stage 4 proposal, which means it's ready to come out in the next edition of the ECMAScript standard and is in the current draft. It brings along four new methods for Array.prototype:
Array.prototype.toReversed() -> Array, returns a reversed version of a shallow copy of the array, leaving the original array intact
Array.prototype.toSorted(compareFn) -> Array, returns a sorted version of a shallow copy of the array, leaving the original array intact
Array.prototype.toSpliced(start, deleteCount, ...items) -> Array, returns a spliced version of a shallow copy of the array, leaving the original array intact
Array.prototype.with(index, value) -> Array, returns a version of a shallow copy of the array, modified at the specific index, leaving the original array intact
as well as three new methods for TypedArray.prototype:
TypedArray.prototype.toReversed() -> TypedArray, see above
TypedArray.prototype.toSorted(compareFn) -> TypedArray, see above
TypedArray.prototype.with(index, value) -> TypedArray, see above
According to their README.md, it has the following implementations
"Change Array by Copy" is a stage 4 proposal, which means it's ready to come out in the next edition of the ECMAScript standard and is in the current draft. It brings along four new methods for
Array.prototype
:Array.prototype.toReversed() -> Array
, returns a reversed version of a shallow copy of the array, leaving the original array intactArray.prototype.toSorted(compareFn) -> Array
, returns a sorted version of a shallow copy of the array, leaving the original array intactArray.prototype.toSpliced(start, deleteCount, ...items) -> Array
, returns a spliced version of a shallow copy of the array, leaving the original array intactArray.prototype.with(index, value) -> Array
, returns a version of a shallow copy of the array, modified at the specific index, leaving the original array intactas well as three new methods for
TypedArray.prototype
:TypedArray.prototype.toReversed() -> TypedArray
, see aboveTypedArray.prototype.toSorted(compareFn) -> TypedArray
, see aboveTypedArray.prototype.with(index, value) -> TypedArray
, see aboveAccording to their README.md, it has the following implementations
The text was updated successfully, but these errors were encountered: