I am trying to print the football value which is inside array using JS. I am not sure how to print it in JS. Right now when I try it prints as undefined. I am providing part of my JS and JSON below, can you guys tell me how to fix it?
if (item.data.football == true) {
console.log("print football---->" + item.data[0].football);
}
"data": [{
"sportsProperty": "Insurance",
"football": true
},
{
"sportsProperty": "Insurance",
"football": true
}]