How to create a property of an object whose name contains a variable? For example:

test={test: 'text'} 

But here you need to create another property depending on the value of the variable.

 test.значение = ещё одно значение; 

How to do this?

    1 answer 1

     var obj = {}, name = 'test'; obj[name] = true; alert(obj[name]); // true 

    Example.