react.dev icon indicating copy to clipboard operation
react.dev copied to clipboard

Added note for toSorted and toReversed methods (Issue #7134)

Open BrianWoolfolk opened this issue 1 year ago • 6 comments
trafficstars

Fixes #7134 This PR addresses the previous issue regarding the new JavaScript methods toSort() and toReversed().

The approach here was to mention the existence of these new methods in the table at the beginning of the page Updating Arrays in State (and made the table bigger).

Before: "copy the array first". Now: "toReversed, toSorted, copy the array first".

Also, in the Making other changes to an array section, there's now a Note block regarding the similitudes with these new methods and the JS spread syntax.

BrianWoolfolk avatar Sep 19 '24 00:09 BrianWoolfolk