internet explorer - JAVASCRIPT : create dynamic key in IE -


this question has answer here:

var jsonuiid = "sdfsdf"; a={         [jsonuiid] : {         "heading":"title"         } }; 

tried directly in developer tools. above code works in browsers. fails in internet explorer. please help.

if don't square bracket[], directly gets "jsonuiid" rather actual value defined above.

computed property names part of es6 not supported browsers. can set object property old-style bracket notation:

var jsonuiid = "sdfsdf"; var = {}; a[jsonuiid] = {     "heading": "title" }; 

Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -