Sorts the keys of an object in alphabetical order and returns a new object with the sorted keys.
sortObject({ b: 2, a: 1}) // { a: 1, b: 2 } Copy
sortObject({ b: 2, a: 1}) // { a: 1, b: 2 }
The input object to sort.
Optional
An optional comparator function to use when sorting the keys.
Sorts the keys of an object in alphabetical order and returns a new object with the sorted keys.
Example