I need to built a object property out of strings
but how could I use the value of this string as property name?
var x = 'a';
var y = 'b';
var xy = x + y;
var z = {
xy: 'some text'
};
Now I could access it via z['xy'] but not via z['ab'].
You’re trying to write
You cannot do this using an object literal.