Webpage crashing

I am trying to solve the Intermediate Algorithm Scripting: Diff Two Arrays, but when i run this the webpage crashes. Can someone tell me why?

function diffArray(arr1, arr2) {
  var newArr = [];
  for (var i = 0; i < arr1.length; i++){
    if (arr2.indexOf(arr1[i]) < 0){newArr.push(arr1[i])}
  }
  for (var x = 0; i < arr2.length; x++){
    if (arr1.indexOf(arr2[x]) < 0){newArr.push(arr2[x])}
  }
  return newArr;
}

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

Reread this carefully

1 Like

Oh I didn’t realize of that, noob mistake lol. Thanks :slight_smile: