Javascript array sort compare util