文章
-
// 删除表格某一行的数据
-
let newData = dataList.filter(v=>v.id!=rowId)
-
setDataList(newData)
-
// 并集
-
let union = a.concat(b.filter(v => !a.includes(v))) // [1,2,3,4,5]
-
// 交集
-
let intersection = a.filter(v => b.includes(v)) // [2]
-
// 差集
-
let difference = a.concat(b).filter(v => !a.includes(v) || !b.includes(v)) // [1,3,4,5]
网友评论