How does JS take out the different values of two arrays and synthesize a new array

for example

var array1 = [ 5,9,8,10,55];
var array2 = [ 5,50,10];
var arr3=[9,8,55,50]
Nov.20,2021

the idea is as follows:

1, take the difference between two arrays

var array1 = [ 5,9,8,10,55];
var array2 = [ 5,50,10];
const newArray = (arr1, arr2) =>{
  return [...arr1.filter(x=> !arr2.includes(x)), ...arr2.filter(x=> !arr1.includes(x))]
} 
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-1e4bcca-43b99.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-1e4bcca-43b99.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?