Simpler union sets, intersections, and unions

is the simplest math problem: finding the set, intersection and union of two arrays.
I know you can use for loops, but is there an easier way?

var arr1 = [3, 5, 1];
var arr2 = [2, 5, 7];
......
Mar.13,2021

  

an easier way is to use wheels built by others
recommended lodash

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3ae64-2c243.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3ae64-2c243.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?