Answers for "js same item in two array"

3

js check if two array have the same element

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

javascript get same elments from multiple arrays

var result = arrays.shift().filter(function(v) {
    return arrays.every(function(a) {
        return a.indexOf(v) !== -1;
    });
});
Posted by: Guest on August-27-2020

Code answers related to "js same item in two array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language