I have a var, let's say
var product = "something"
I have a json file that looks like
{
"something": [
{
"price": "2000"
}
],
....
I need to access "price" from "something", so I'm trying
data.product.price
and it gives me undefined. I can easily get price value using data.something.price , but in my case it won't work because var product is dinamic value, so I need help with parsing my json, using my var as a key.