nzakas/computer-science-in-javascript — pull request #20 by tmoc (2014-11-29 18:53:30+00:00)
Title: Changed inner loop on bubble sort implementations so that they do not needlessly compare the last item to an undefined value when i is 0

Previously the inner loop on these functions would unnecessarily compare the last value in the array to an undefined index (which happens to evaluate to false in JavaScript) on the first iteration.

This implementation eliminates one unnecessary loop iteration and makes the algorithm more translatable to other languages where comparing a number to an empty index would cause an error.