My JSON object evaluates to:
{ \"@io\": IO, \"@type\": XXX }
If this variable is called my_json, how do I access the @ty
my_json
@ty
Use square bracket notation with a string:
var XXXValue = my_json['@type'];
The same can be used when you have a property name in a variable. Using your same example:
var propertyName = '@type'; var XXXValue = my_json[propertyName];