arrSort = new Array(3, 4, 5, 6, 4, 2)
console.log(
arrSort.sort(
function (a, b) {
if (a > b) {
return 0
// return 1
}
return -1
}
)
);
Sort中的函數值,返回0或者1,都會發生順序調換