function compare(value1,value2){
if(value1<value2){
return -1;
}else if(value1>value2){
return 1;
}else{
return 0;
}
var test=[0,1,4,5,15,6,4];
var result=test.sort(compare);
console.log(result);
IvanAstrochicha
相关分类