
array.sort() – Sorts the elements of an array **in place** and returns the sorted array.
๐ Syntax
array.sort(compareFunction);
๐งช Example
[3,1,2].sort(); // [1,2,3]
array.sort() – Sorts the elements of an array **in place** and returns the sorted array.
array.sort(compareFunction);
[3,1,2].sort(); // [1,2,3]
Comments
Post a Comment