Javascript Sort Array Without Using Functional Assessments