I want to create a adjacency list using json object. I would like to implement json object for adjacency list in the following format.
var JSONobj= {node1:[{x1,y1},{x3,y3},{x4,y4}], node2:[{x2,y2},{x3,y3}], node3:[]}
My doubt is, whether I can add values to coordinate list dynamically such as JSONobj.node3[0]={x4,y4}?
or is there any better way to add values to JSONobj from outside the object declaration?
You can push elements into a JSON object since its just a pretty array.