Sorts the keys of an object based on the provided sort method and direction.
Sorts the keys of an object based on the provided sort method and direction. Only the order of the fields changes; every value stays attached to its own key and nothing is added or removed. Use this when a target system expects fields in a predictable order, or simply to make your output easier to read. You can sort alphabetically up or down, or put specific keys first in an order you choose.