Bubble and merge sorts are much faster than the native JavaScript sort.
Bubble sort looks over the elements, swaps anything that is out of order, and repeats until it is finished.
space complexity: O(1)
time complexity: O(n^2)
Merge sort divides an array of N elements into N arrays of 1 element, merges adjacent arrays in sorted order, and repeats until it is finished.
space complexity: O(n)
time complexity: O(n * log(n))