.toSorted()

Term side of the Card
Topic: Array
Unit title: .toSorted()
Categories: Method
Explanation side of the Card

Explanation: The method that returns a new array with the elements sorted according to the provided comparison function, without changing the original array. Unlike `.sort()`, this method doesn't modify the original array.

Browser compatibility:
  • The chrome browser supports this feature starting from version 110
  • The edge browser supports this feature starting from version 110
  • The firefox browser supports this feature starting from version 115
  • The safari browser supports this feature starting from version 16
Availability: