open_in_new
content_copy
A = [1, 2, 3, 4]; B = [1, 3, 4, 7]; diff = A.filter(x => !B.includes(x) ); console.log(diff);