The array to sort
Optional
propertyKey: string = ""The property key to sort by, if any; can be a dot-separated path
Optional
sortOptions: { ascending?: boolean; ignorePunctuation: boolean; numeric: boolean } = {}Options affecting the sorting of elements
Optional
ascending?: booleanWhether the sort should be ascending (true) or descending (false).
Whether punctuation should be ignored.
Whether numeric collation should be used, such that "1" < "2" < "10".
The sorted array
Sort an array in-place using a language-aware comparison function that can sort by a property key. If no property key is provided, the array is sorted directly.