get data from dynamic key value in json
You can access the property using array-like syntax:
data[inputLocation]
If inputLocation
is set to "Aspen"
, then it is the same as these two lines:
data["Aspen"]
data.Aspen
You can access the property using array-like syntax:
data[inputLocation]
If inputLocation
is set to "Aspen"
, then it is the same as these two lines:
data["Aspen"]
data.Aspen