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