How does the ID under a single item match the values in the array

clipboard.png

if(misslove.product.info.id == Keysplit){
   this.WiImgB = true;
  }else{
    this.WiImgA = true;
  }

misslove.product.info.id = 75

The value of

Keysplit is 0: "75"

how to match the value in the Keysplit array with ID, and query whether this value exists.

Nov.16,2021

Keysplit.indexOf (id)! =-1
or
Keysplit.includes (id);


ES5:


let Keysplit = ["75", "93", "112", "57", "127"]

Keysplit.forEach(element => {
    if (misslove.product.info.id == element - 0) {
        console.log(misslove.product.info.id); //id
    }
});
Menu