I have two object arrays:
var a = [ {id: 4, name: \'Greg\'}, {id: 1, name: \'David\'}, {id: 2, name: \'John\'}, {id: 3, name: \'Matt\'}, ] var b = [
If you drop the null criteria (many in the community are saying using null is bad) then there's a very simple solution
null
let a = [1, 2, 3]; let b = [2, 3, 4]; a.filter(x => b.includes(x)) // [2, 3]