ES6 比较俩个数组 是否含有相同项
```js
let array = [
{ id: 1, name: '123' },
{ id: 2, name: '456' },
{ id: 3, name: '678' },
{ id: 4, name: '789' },
{ id: 5, name: '234' }
]
let tempArray= [3, 4]
let date = array.filter(item => tempArray.indexOf(item.id) > -1)
console.log('...
原创
2021-06-15 10:34:09 ·
2148 阅读 ·
0 评论