Tell us what’s happening:
The code written below runs in both the chrome console, and in VScode, but when I try to run in it in FCC, nothing happens. Is this a bug? or is the FCC editor just picky?
Your code so far
function diffArray(arr1, arr2) {
for(let i=0;i<=arr2.length;i++)
if(arr2[i] !== arr1[i]){
return arr2[i]
}
}
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) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/diff-two-arrays/