SOURCE

var temp = [4, 6, 78, 9, 0, 1, 4, 8, 34, 78, 08]
var t = null;
for (var i = 0; i < temp.length - 1; i++) {
    for (var j = 0; j < temp.length - 1 - i; j++) {
        if (temp[j] > temp[j + 1]) {
            t = temp[j];
            temp[j] = temp[j + 1];
            temp[j + 1] = t;
        }
    }
}
console.info(temp);
console 命令行工具 X clear

                    
>
console