I have two arrays. If arrayTwo has color "blue and "red" then return "blue painting", "red sofa", "blue pot" from arrayOne.
var arrayOne = ["green wall", "blue painting", "red sofa", "yellow shelf", "blue pot"];
var arrayTwo = ["blue", "red"];
for (var i=0; i < arrayOne.length; i++ ) {
if (arrayOne[i] == "blue" || "red"){
// this should give colors that match in arrayOne
}
}
edit: I want to know if the words match in array one and two. But not hardcoding it.