I have an object that I built dynamically:
obj = {};
obj.prop1 = 'something';
obj.prop2 = 'something';
obj.prop3 = 'something';
With this, I now need to take an element from the array and use it to determine both the equivalent of "propX" and its value
I thought that if I did something like
obj.[arr[0]] = some_value;
What, this will work for me. But I also realized that the error I get is a syntax error. "Missing name after statement." Which I understand, but I'm not sure how to get around this. The ultimate goal is to use the value of the array element as the name of the property for the object, and then define this property with another variable to be passed. My question is how can I achieve this, so the appendage to the object will be considered as
obj.array_value = some_variable;