The issue is in your for loop, for each product you are checking if it is in your list of products, and if it isn't, you break the loop, the issue is that you are breaking the loop the first time! so unless the item the user wants is the first item in your list the for loop cannot find it. A better way is to do this:
var n = fruits.includes(products);
if (n) {
console.log("Yes we do have that product")
} else {
console.log("Now we don't have that product")
}
The issue is in your for loop, for each product you are checking if it is in your list of products, and if it isn't, you break the loop, the issue is that you are breaking the loop the first time! so unless the item the user wants is the first item in your list the for loop cannot find it. A better way is to do this:
OMG [email protected]
np @HannahWyse