Contact: aviboots(AT)netvision.net.il
39,870 questions
51,793 answers
573 users
const arr1 = [22, 26, 1, 8, 18, 99, 81]; const arr2 = [1, 8, 99, 5, 12, 19, 120]; let common = arr1.filter(function(obj) { return arr2.indexOf(obj) !== -1; }); console.log(common); /* run: [ 1, 8, 99 ] */