I am dealing with a dynamic object where the property values change based on different data sets.
For example:
MyObj = { country:"Ind", Place:"Pune"}
Now, I have a data value that determines which property value I need to retrieve.
var MyArr = this.FiltArr[0].property;
This will assign myArr = country
, and I will later use it like this:
MyObj.Myar = // my code..
Both the object and MyArr value are dynamic. The object may change, and the 'country' property may change to something else. Any suggestions on how to handle this?
Whenever I reference MyArr, I want to access the corresponding attribute in MyObj. How can I accomplish this?