arr.sort((x, y) => { if(x > y){ return 1; }else{ return -1; } return 0; });
这一行是永远运行不到的,可以删除掉。
return 0;
Sign in to make a reply
Up.