stargateatlantis
asked on
processing JSON advanced
I have the following JSON I was wondering how would you process it using JavaScript
I want to console.log teamname. SportsTypes
I want to console.log teamname. SportsTypes
[
{
"teamname": "Bulldogs",
"nickname": "",
"SportTypes": {
"-JZLOh7KtM78I5wAL6Ua": true
},
"locations": {
"-JZLCFtpcuvsYxb5N1Cc": true
}
}
]
ASKER
So would I do this
Console.log(myobject[0].SportTypes['-JZLOh7KtM78I5wAL6Ua']);
Yes, that is what you'd need to do to get that value.
You could also use the for/in loop to get the value too
You could also use the for/in loop to get the value too
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Console.log(myobject[0].te
Console.log(myobject[0].Sp