Algorithm not passing

function diffArray(arr1, arr2) {
  var newArr = [];
  
  for (let item of arr1) {
		if (arr2.includes(item) === false) {
			newArray.push(item);
		}
	}

	for (let item of arr2) {
		if (arr1.includes(item) === false) {
			newArr.push(item);
		}
	}
  
  return newArr;
}

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

I’ve copy and pasted all the input and all of it returns the correct output. Why is this not passing?

Thanks in advance!

You are referencing a variable named newArray, but you have not defined such a variable anywhere in your code.

1 Like

ooooohhhhhhh myyyyyy gooooosh lol

Thank you for pointing that out! Fixed the problem.