Suppose I have a JS object zoneJSObject
which has a structure like this:
zoneJSObject = {"ZoneWidgets" : ""}
when creating this object I don't know how many ZoneWidgets I'll have. So I can't pre-define a set structure for them. ZoneWidgets will be a array of integer id's eg. "123456789", further on I want to acquire coordinates for each of these widgets. So ZoneWidget 123456789 will have 4 key:value pairs top,bottom,left,right how can I add these under the specific widget?
data = "111222.333"
zoneJSObject[0].ZoneWidgets[0] = "123456789"
zoneJSObject[0].ZoneWidgets[0].top = data // tried adding it like this but got this error
Uncaught (in promise) TypeError: Cannot create property 'top'