I received a JSON object that has the following structure:
[
{
"competition": {
"name": "Premier League",
},
"nextState": 1,
"team_id": 1
}, {
"competition": {
"name": "Premier League",
},
"nextState": 1,
"team_id": 2
}
]
This is just a simplified version of the JSON data, and I am attempting to retrieve the team_id information.
result = JSON.stringify(result, null, 4);
console.log(result);
$('#test').append(result);
alert(result[0].team_id);
Despite my efforts, I keep getting 'undefined' as a result. Am I not accessing it correctly?
Thank you!