1.两个数组合并,并且排序
<script> let arr1 = ['2','6','12','15','23'] let arr2 = ['12','8','22','25','13','9','18'] let arrs = arr1.concat(arr2) function b(c,d){ return c-d } arrs.sort(b) console.log(arrs) //['2', '6', '8', '9', '12', '12', '13', '15', '18', '22', '23', '25'] </script>