Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

代码不够抽象 #7

Open
huluoyang opened this issue Jun 3, 2019 · 0 comments
Open

代码不够抽象 #7

huluoyang opened this issue Jun 3, 2019 · 0 comments

Comments

@huluoyang
Copy link

sort 是一个抽象程度很高的数组方法,在 v8 中根据ECMAScript 中定义的 sort 方法有了具体实现。
开发者只需关注参数的顺序即可,例如:

[1,2,5,11,9].sort((a,b)=>a-b) // [1,2,5,9,11]
[1,2,5,11,9].sort((a,b)=>b-a) // [11,9,5,2,1]

此处的修改可以参考我的代码哦,^_^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant