<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title></title> <script type="text/javascript"> var arr =[123,344,334,2334]; arr.sort(function(n1,n2){ if(n1<n2){ return -1; } else if(n1>n2){ return 1; } else{ return 0; } }) alert(arr) </script> </head> <body> </body></html>
添加回答
举报
0/150
提交
取消