随笔分类 -  Js

摘要:1 let obj1 = { 2 a: 0, 3 b: 0 4 } 5 let obj2 = '' 6 7 // obj2 = obj1 8 // obj2.a = 10 9 // console.log(obj1, obj2); //{ a: 10, b: 0 } { a: 10, b: 0 } 阅读全文
posted @ 2020-09-14 12:21 南柯Dream丶 阅读(255) 评论(0) 推荐(0)
摘要:1.数组交集 普通数组 1 const arr1 = [1, 2, 3, 4, 5, 8, 9], arr2 = [5, 6, 7, 8, 9]; 2 const intersection = arr1.filter(val => arr2.indexOf(val) > -1) 3 console. 阅读全文
posted @ 2020-09-11 15:17 南柯Dream丶 阅读(213) 评论(0) 推荐(0)
摘要:1.some() 2. reduce() 3. Every() 4. map() 5. flat() 6. filter() 7. forEach() 8. findIndex() 9. find() 10. sort() 11. concat() 12. fill() 13. includes() 阅读全文
posted @ 2020-09-10 10:59 南柯Dream丶 阅读(241) 评论(0) 推荐(0)