Web features explorer

Array by copy

Newly available since 2023-07-04
Tags: javascript Groups: JavaScript > Collections > Arrays JavaScript > Collections > Typed arrays

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. To learn more, see Array.prototype.toReversed(), Array.prototype.toSorted(), Array.prototype.toSpliced(), Array.prototype.with() at MDN.

Compatibility