Diff two Arrays not working!

Tell us what’s happening:
Why isn’t this working?

Your code so far


function diffArray(arr1, arr2) {
var newArr = []
for (let i = 0 ; i < arr1.length; i++){
  if (arr1.includes(arr2[i]) == false){
    newArr.unshift(arr2[i])
  }
}
return newArr
}

console.log(diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]));

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:82.0) Gecko/20100101 Firefox/82.0.

Challenge: Diff Two Arrays

Link to the challenge:

You’re only looping over the first array. I think you’ll understand if you run your code with these parameters:

console.log(diffArray([1, 2], [1, 2, 3, 4, 5, 6, 7]));

Your solution returns an empty array, while it should return [3, 4, 5, 6, 7]