Computed property names are supported in ECMAScript2015:
var name = 'key'; var value = 'value'; var o = { [name]: value }; alert("o as json : " + JSON.stringify(o));
2.1m questions
2.1m answers
60 comments
57.0k users