lundi 1 novembre 2021

Checking if a condition is true inside an array [duplicate]

Can someone explain me why this won't work, and how to make it work.

let array = ["item1", "item2", "item3"]

console.log(array)

if (array === "item1") {
console.log("true")
} else {
console.log("false")
}let array = ["item1", "item2", "item3"]

console.log(array)

if (array === "item1") {
console.log("true")
} else {
console.log("false")
}

Aucun commentaire:

Enregistrer un commentaire