Simple Sorting Algorithm Simulator in JavaScript