If you are intent on trying the filtering out duplicates method, maybe you could try checking each item to see if indexOf is equal to lastIndexOf. If only one of the item exists, it will return true.
Hi, you need to first define the max and min value of the first and last index of the array. Then, initialize the property you want to return. Then, use a for loop to iterate through the contents of first array if the index of the second array is equal to -1. Then, push the contents of the first array which is accessed with the [i] then use the functions global scope to call the diff between arr1 and (arr1, arr2) / (arr2, arr1), finally return newArr… The function is created after the array has been emptied.