Tell us what’s happening:
What is the issue with the code so far? the console log shows the correct output but its not showing the string with quotation marks.
Your code so far
function diffArray(arr1, arr2) {
let concatArray = arr1.concat(arr2);
let newArray = [];
function included(x){
if(arr1.includes(x) == false || arr2.includes(x) == false){
return x
}
}
newArray.push(concatArray.filter(included));
return newArray;
}
console.log(diffArray([1, "calf", 3, "piglet"], [1, "calf", 3, 4]));
If you’re talking about "calf" and "piglet", then the strings to not contain any quotation marks. Rember that in order for JavaScript to know when a string begins and ends it must be wrapped in quotes.