I am using an object in javascript and I need to get it's values by dynamic attributes, how do I use concatenation to get the right syntax ?
To make it clearer this is my code:
dataObj[0].xxxxxxxx.Value;(xxxxxxx -> dynamic)
I tried: set my attr name in a var :
var curr = "games" - > `dataObj[0].+curr+.Value;` //- NO GOOD
use [] - > `dataObj[0].[curr].Value` //- NO GOOD
use +"+ - > `dataObj[0].+'"'+curr+'"'+.Value` //- NO GOOD