There is a js object array var ary=[{id:1,name:"b"},{id:2,name:"b"}]. The requirement is to sort based on the value of name or id. Here is Coquettish function
Function definition:
Use:
The above is the entire content of this article. If you are in need, please come and study it carefully, haha.