Sort Array Of Objects Javascript Based Interview