const a = [7, 8, 9]; const b = [4, 5, 6, 7, 8, 9]; const filteredB = b.filter(item => !a.includes(item)); console.log(filteredB); // [4, 5, 6]
js 数组过滤数组
最新推荐文章于 2024-11-13 01:18:00 发布
const a = [7, 8, 9]; const b = [4, 5, 6, 7, 8, 9]; const filteredB = b.filter(item => !a.includes(item)); console.log(filteredB); // [4, 5, 6]