Sort Array Without Using Sort Function Js