var arr2=[100,20,3,23,7];
console.log(arr2.sort(down));
function add(i,j){ //升序(从小到下)
return i-j;
}
function down(i,j){ //降序(从大到小)
return j-i;
}

相关文章:

  • 2021-12-09
  • 2021-04-23
  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
  • 2021-11-02
  • 2022-12-23
  • 2022-03-08
猜你喜欢
  • 2021-08-16
  • 2021-09-19
  • 2021-07-31
  • 2022-02-09
  • 2021-11-06
  • 2022-12-23
相关资源
相似解决方案