不小心发现bug二枚,sort()方法

来源:6-4 关联字符串-代码演示

_玲

2019-03-08

The sort() method sorts the elements of an array in place and returns the array. The default sort order is built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values.

var array1 = [1, 30, 4, 21, 100000];
array1.sort();
console.log(array1);
// expected output: Array [1, 100000, 21, 30, 4]

幸运的老师,没有十位数以上的。

写回答

1回答

快乐动起来呀

2019-03-08

嗯嗯,这个是要注意的,你怎么不回复我要不要换工作哈哈

1
2
旋涡鸣人_
回复
_玲
....小姐姐 很厉害啊 赞一个
2019-10-03
共2条回复

JavaScript版 数据结构与算法

填补前端同学的算法短板,掌握面试中最常见的算法与数据结构

2467 学习 · 395 问题

查看课程