Array by copy
Newly available since 2023-07-04
The toReversed()
, toSorted()
, toSpliced()
, and with()
methods of arrays and typed arrays return changed copies of arrays. They stand in contrast to methods such as sort()
or reverse()
that change arrays in place.
Learn more
Specifications
- ECMAScript® 2026 Language Specification (#sec-array.prototype.toreversed), from TC39 (Ecma International).
- ECMAScript® 2026 Language Specification (#sec-array.prototype.tosorted), from TC39 (Ecma International).
- ECMAScript® 2026 Language Specification (#sec-array.prototype.tospliced), from TC39 (Ecma International).
- ECMAScript® 2026 Language Specification (#sec-array.prototype.with), from TC39 (Ecma International).
- ECMAScript® 2026 Language Specification (#sec-%25typedarray%25.prototype.toreversed), from TC39 (Ecma International).
- ECMAScript® 2026 Language Specification (#sec-%25typedarray%25.prototype.tosorted), from TC39 (Ecma International).
- ECMAScript® 2026 Language Specification (#sec-%25typedarray%25.prototype.with), from TC39 (Ecma International).
Browser support
- Chrome 110 Released on 2023-02-07
- Chrome Android 110 Released on 2023-02-07
- Edge 110 Released on 2023-02-09
- Firefox 115 Released on 2023-07-04
- Firefox for Android 115 Released on 2023-07-04
- Safari 16 Released on 2022-09-12
- Safari on iOS 16 Released on 2022-09-12
Developer signals
- State of JS 2024: reading_list/reading_list question
- State of JS 2024: features/array_features question
Usage (according to Chrome Platform Status)
~1.195% of page loads. More data at chromestatus.
View as JSON | Edit this feature | Report an issue | Web-features entry: source, dist