0

so i'm trying to get value from checking if some elements included in array of object which i get from axios response.

the thing is the value is always false

here is the code:

 var ceck = this.state.cek;
    var coba = ceck.includes("16");
    console.log(coba);

and this is the output of var ceck:

(3) [{…}, {…}, {…}]
0: {id_esport: 16}
1: {id_esport: 15}
2: {id_esport: 22}
length: 3
__proto__: Array(0)

thank you so much for your help

EDIT: i tried this

if (ceck.some(e => e.Name === '16')) {
  console.log("success")
}

nothing cames out

0 Answers0