前端面试复习记录(2020-03-21)
1.事件冒泡和事件捕获
总结:
冒泡是越来越大,也就是从具体的元素到父级元素传递
[2.获取两个简单集合的交集和补集]
总结:
let a = new Set([1, 2, 3]);
let b = new Set([3, 5, 2]);
// 并集
let unionSet = new Set([...a, ...b]);
//[1,2,3,5]
// 交集
let intersectionSet = new Set([...a].filter(x => b.has(x)));
// [2,3]
// ab差集
let differenceABSet = new Set([...a].filter(x => !b.has(x)));
// [1]