Javascript, to proceed, have we must!
Selection Sort Algorithm
Select the first item.
Also select the highest item to its right.
Swap them if they are out of order.
Select the next item and repeat steps 2 and 3.
Once you are done with the last two items, the set will be in sorted order.
Completion time grows in quadratic proportion to the size of the array i.e. Order of Growth is $\mathcal{O}_{n^2}$.
Read more at Sedgewick, Robert and Wayne, Kevin.
"Elementary Sorts"
Algorithms, 4th Edition.