Sorting


Sorting Numbers in an Array

Numbers are not sorted alphabetical order
The function must return a zero if the numbers are equal.
The function must return a negative number if the items are in the correct sequence
The function must return a positive number if the items need to be swapped.

write([6, 4, 2, 27, 17].sort( function (first, second) { 
   return first - second;
}




© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited TopPrevNext