Answers for "return matching element from two array javascript"

1

javascript find matching elements in two arrays

const intersection = array1.filter(element => array2.includes(element));
Posted by: Guest on June-25-2020
0

how to get different values from two arrays js

let difference = arr1
                 .filter(x => !arr2.includes(x))
                 .concat(arr2.filter(x => !arr1.includes(x)));
Posted by: Guest on March-09-2021

Code answers related to "return matching element from two array javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language