Computed property names are supported in ECMAScript2015:
var name="key";
var value="value";
var o = {
[name]: value
};
alert("o as json : " + JSON.stringify(o));
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer