> ## Content Index
> Fetch the complete content index at: https://blog.hacking.pub/llms.txt
> Use this file to discover other available public pages before exploring further.

# js sort函数
- URL: https://blog.hacking.pub/2016/12/27/js-sorthan-shu/
- Published: 2016-12-27T15:22:33.000Z
- Updated: 2016-12-27T15:22:33.000Z
- Author: chainhelen
- Tags: js, javascript, sort

```
[1, 7, 10].sort()  
[1, 10, 7]

```

sort在不接受任何参数的时候，会把每一个输入当成字符串，按照字典顺序进行排序