📌  相关文章
📜  如何从数组javascript代码示例中获取10个中的5个字符串元素

📅  最后修改于: 2022-03-11 15:02:00.945000             🧑  作者: Mango

代码示例1
const items = ['a', 'b', 'c', 'd', 'e', 'f']
const valuesToRemove = ['c', 'd']
const filteredItems = items.filter(item => valuesToRemove.includes(item))
// ["a", "b", "e", "f"]

console.log(filteredItems)