07 2021 档案

摘要:方法一 const arr = [6, 3, 5, 6]; let arrTwo = [ { value: 3, bool: false }, { value: 1, bool: false }, { value: 2, bool: false }, { value: 4, bool: false  阅读全文
posted @ 2021-07-09 08:49 大强子pq 阅读(1075) 评论(0) 推荐(0) 编辑
摘要:一.利用reduce去重 const testArr = [1, 2, 2, 3, 4, 4, 5, 5, 5, 6, 7]; testArr.reduce((acc, cur) => { if (!acc.includes(cur)) { acc.push(cur); } return acc; 阅读全文
posted @ 2021-07-05 08:59 大强子pq 阅读(30) 评论(0) 推荐(0) 编辑
摘要:方法一:不改变原来对象 let item = { name: "张三", age: "18", gender: "男", }; console.log(item); // {age: "18",gender: "男",name: "张三"} let { age, ...params } = item 阅读全文
posted @ 2021-07-02 18:28 大强子pq 阅读(1431) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示