I only have a basic understanding of coding and hope for your help. I have this js code giving me a true false log for all sausage dog occurrences in the array:
var myAnimal = "Sausage Dog";
var arrayAnimal =["Sausage Dog", "Tiger", "Sausage Dog", "Crocodile", "Lion"];
for (var i = 0; i < arrayAnimal.length; i++) {
if(myAnimal == arrayAnimal[i]) {
console.log("True");
} else {
console.log("False");
}
}
How would I do the same task if var myAnimal was an array with multiple strings?
So it would check every animal in myAnimal against every animal in var arrayAnimal and return a true/false for all occurrences.
Is there a way of doing that?