A JavaScript implementation of the selection sort algorithm