js中如何实现快速排序789?-灵析社区

Kapp啊$0920

js中的排序方法有很多,我推荐你试试Array.prototype.sort()这个api呢。 const numbers = [7,9,3,1,5,123,456,789]; const arr = numbers.sort((a, b) => a - b); console.log(arr ); ![](https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241120/4b8956c43e073d063dc18a83ec0a3676.png)

阅读量:1

点赞量:0

问AI