kindring 3 năm trước cách đây
mục cha
commit
643dacc0d0
1 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 3 2
      js/合并数组中的key值.md

+ 3 - 2
js/合并数组中的key值.md

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-08-20 16:17:21
- * @LastEditTime: 2021-08-20 17:10:41
+ * @LastEditTime: 2021-08-20 17:14:18
  * @LastEditors: Please set LastEditors
  * @Description: 
  * @FilePath: \md-\js\合并数组中的key值.md
@@ -64,6 +64,7 @@ arr.reduce((r, o) => ((r[o.key] = {...r[o.key], ...o}), r), []).filter(i => i)
 在这个版本大佬看见数据结构的key值是用数字组成的,可以转换为数组下标
 
 #### **晨晨大佬的一行版本扩写**
+```js
 // 晨晨大佬一行版本修改
 let x2 = arr.reduce((r,o)=>{
     // 通过解构进行合并不同的项
@@ -73,7 +74,7 @@ let x2 = arr.reduce((r,o)=>{
 // 因为key值不是百分百都对应数组的下标.所以用filter过滤
 x2 = x2.filter(i=>i)
 console.log(x2);
-
+```
 <!-- tabs:end -->
 
 ### 其他方式处理