The values in arr2 will be compared with that of arr1.
process :
First arr2 will pass a value to a1, which then invokes the other filter command. now arr1 will pass a value to a2.
The values from arr1( which is a2) and value from arr2( which is a1) will be compared and the a2 will be returned from the 2nd filter command, when a1 is not equal to a2.
and this way all the values will be evaluated one by one.
I don’t think you understand how filter() works.
It puts every value in the array through the callback, which should return a boolean. The result will be an array containing those values that resulted in a true return from the callback function.