Sunday 12 March 2017

adding variables inside nested objects

I have a nested object that looks like this

var a = "example"
{Chatting : {a :{ 'id' : 'a'}}}

I can't really find anything online, I tried the code below and its not working

myobj['Chatting'][a] = {
'id': a
 }



via slimboy

No comments:

Post a Comment