摘要: es6快速排序 let qsort = fn =>([x,...xn]) => x == null ? [] : [ ...qsort(fn)(xn.filter(a=>fn(a,x))), x, ...qsort(fn)(xn.filter(a=>!fn(a,x))) ] es5写法:consol 阅读全文
posted @ 2019-07-26 17:00 皓ma 阅读(2605) 评论(0) 推荐(0) 编辑
摘要: let data = [ { id: 201801, name: '张三', age: 15, }, { id: 201804, name: 'John', age: 18, }, { id: 201802, name: '李四', age: 18, }, { id: 201801, name: ' 阅读全文
posted @ 2019-07-26 16:56 皓ma 阅读(334) 评论(0) 推荐(0) 编辑
摘要: // 从小到大顺序排序 minSort (arr) { var min for (var i = 0; i < arr.length; i++) { for (var j = i; j < arr.length; j++) { if (arr[i].coupon.faceMoney > arr[j] 阅读全文
posted @ 2019-07-26 15:49 皓ma 阅读(4501) 评论(0) 推荐(0) 编辑