代码如下:
function where(arr, num) {
var arr1=Array.prototype.slice.call(arguments,0);
arr1.sort(function(a,b){
return b-a;
});
alert(arr1);
}
where([3, 10, 5], 3);
输出的结果是 3,10,5,3 ;怎么才能输出 3,3,5,10 ?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
小伙看你根骨奇佳,潜力无限,来学PHP伐。