简单排序---冒泡排序

function bubbleSort(arr) {
    var numElement = arr.length;
    var temp;
    for (var outer = numElement; outer >= 2; --outer) {
        for (var inner = 0; inner <= outer - 1; ++inner) {
            if (arr[inner] > arr[inner + 1]) {
                temp = arr[inner + 1];
                arr[inner + 1] = arr[inner];
                arr[inner] = temp;
            }
        }
    }
    return arr
}