我有两个数组
["bye", "good morning"];
如何从数组a中删除数组b中存在的项目(没有变异)?结果数组应如下所示: -
Microservices Sample Architecture
答案 0 :(得分:3)
filter()和some()
let a = ["Hello", "bye", "good morning", "test"],
b = ["Hello", "test"],
c = a.filter( e => !b.some( i => i===e))