SOURCE

function paixu(arr){
    if(Object.prototype.toString.call(arr) == "[object Array]")
    arr.sort((a,b)=>a-b);
    return arr;
}
let arr= [1,2,4,3];
console.log(paixu(arr));
console 命令行工具 X clear

                    
>
console