I have the following problem when i try to post a json object to a java API backend. The post method require an Object which contains list of objects.
Is it possible to create a list of objects inside a javascript Object . I understand that we can create a "Array" of objects inside a Object . But in my case , i need the data structure to be as follows .
if you notice , the object list inside the assignToMap Object consists of key value pairs where the key is an integer and the value is an array . I did try , but all i could find as a solution was creating a array of objects inside a Object as follows .
Any help would be appreciated .




123whose value is an array:assignToMap = {123:[1,2,3,4]}