Array by copy
Widely availableThe 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.