Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

intersection and difference in javascript


const intersection = new Set(Array.from(set1).filter(x => set2.has(x)));
const difference = new Set(Array.from(set1).filter(x => !set2.has(x)));
Source by riptutorial.com #
 
PREVIOUS NEXT
Tagged: #intersection #difference #javascript
ADD COMMENT
Topic
Name
1+8 =