react.dev
react.dev copied to clipboard
Added note for toSorted and toReversed methods (Issue #7134)
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.