I'm trying to find a way to check if the word "miami" appears in this array and print out if it does or doesn’t. I'm not sur wether to use the for loop or forEach loop. How can I print "true" the fact that the word "miami" exists in the array bellow?
let word = "miami";
let arr = ["bcn", "mia", "sao", "mex", "par", "miami", "ams", "ber", "paris", "lis", "mad"];
for (let i = 1; i <= 11; i < arr.length; i++) {
if (i === 21){
console.log("miami");
break;
} else {
console.log(i);
}
}