Tell us what’s happening:
Your code so far
function diffArray(arr1, arr2) {
var newArr = [];
// Same, same; but different.
for(var i = arr1[0]; i <= arr1.length - 1; i++) {
for(var j = arr2[0]; j <= arr2.length -1;j++ ) {
arr1[i] == arr2[2] ? "next" : newArr.push(arr1[i]);
}
}
return newArr;
}
diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/diff-two-arrays