摘要: sort⽅法接收⼀个函数作为参数,这⾥嵌套⼀层函数⽤来接收对象属性名,其他部分代码与正常使⽤sort⽅法相同. var arr = [ {name:'zopp',age:0}, {name:'gpp',age:18}, {name:'yjj',age:8} ]; function compare(p 阅读全文
posted @ 2022-05-16 14:41 front-gl 阅读(339) 评论(0) 推荐(0) 编辑