Indirectly Address data in an OBJECT

I am fetching exchange rate data using startWebRequest. Then I use JSON.parse(content) to organize the data. I want to be able to indirectly address the Rates.data.xxx part of the object.
For example, if I want to know the exchange rate for USD I would have to look at the object like this:

Rates.data.USD

something like
var x = “USD”
Rates.data.x??? That does not work.

But I want the USD part to be controlled by a variable so I can ask for the exchange rate of any country I choose.
Any suggesitions?

https://studio.code.org/projects/applab/WGuDvWmXX_KEK0DLsUjHa4ORVZyFmAmC78ywW4IdvBg

Alternately, how can I pick out specific countries info from the raw data returned from the startWebRequest command? Any ideas are appreciated.

Have you tried Rates.data[x].

1 Like

Wow…yes it was that simple. I tried many different notations but not that one.
Thanks a lot.