Sort Array By Object Key Value Javascript Function How To Use