Sorting Algorithms in JavaScript posts