摘要: // keyBy function keyBy(list, by) { return list.reduce((acc, x) => { acc[by(x)] = x; return acc; }, {}); } console.log( keyBy( [ { id: 1, name: "beile 阅读全文
posted @ 2022-08-25 10:39 蓓蕾心晴 阅读(334) 评论(0) 推荐(0) 编辑