数组 filter 另一个数组(两个数组中找出相似的数据)
const arr1 = [ '/router1/tricc1', '/router1/tricc2', '/router2/tricc1', '/router2/tricc2', '/router3/tricc1', '/router3/tricc2', ] const arr2 = [ 'router1', ] const intervenemenuarr = arr1.filter(item => { return arr2.find(prop => { return item.includes(prop); }); }); console.log(intervenemenuarr) // ['/router1/tricc1','/router1/tricc2',]