I am not really sure about the therm I use in my title, but here we go.
So I have something like that:
for (var key in myObject) {
var GivenName = theObject.PS_1.GivenName;
var GivenName = theObject.PS_2.GivenName;
var GivenName = theObject.PS_3.GivenName;
var GivenName = theObject.PS_4.GivenName;
// and so on...
}
So obviously I don't wanna write everything like that, I need to use the var Key, but I didn't figure how the hell I am supposed to do that, I tried alof of thing, but I failed everytime, yes I'am bad and I should feel bad.
I tried this:
var GivenName = 'theObject.'+key+'.FirstName';
var GivenName = theObject.key.FirstName;
var GivenName = theObject.[key].FirstName;
var GivenName = theObject.['key'].FirstName;
var GivenName = theObject.[+key+].FirstName;
btw the Key var contain PS_1 then PS_2 then PS_3...