const numArr = [2, 4, 8, 609545, 2, 8, 4, 1, 10, 123, 99];const strArr = ["what", "We", "have", "lost", "will", "never"];console.log(strArr.sort());console.log(numArr.sort());
2 回答
ITMISS
TA贡献1871条经验 获得超8个赞
The sort() method sorts the elements of an array in place and returns the array. The sort is not necessarily stable. The default sort order is according to string Unicode code points.
是Unicode,别的语言也需要排序。
添加回答
举报
0/150
提交
取消
