Sort an array of objects by one or more properties in any order. Multiple properties and custom comparison functions can be used.