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
Post a Comment