Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js arrays check if there is intersection

// Use a combination of Array.prototype.filter and Array.prototype.includes:
const filteredArray = array1.filter(value => array2.includes(value));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #arrays #check #intersection
ADD COMMENT
Topic
Name
3+4 =