Sort Object Array Javascript Function How To Use