I am building my own Json and I was just wondering if you could make a list of Json objects like this "familyList":{} instead of "familyList":[ {}, {}, {}] because in the one with the '{' instead of the usual '[' you can put a key next to the {} like "Mother":{} which will be easier for me to sort through since I will be having a lot of data instead of having to open multiple brackets like this: {}, {}, {}. I am relatively new to JSON so an answer would be greatly appreciated :) !
1 Answer
If i understand you correctly you want something like this:
familyList = {{}, {}, {}}; I do not believe that is valid json. Perhaps, the below is what you are looking for.
familyList = {"Mother": {}, "Father": {} } Maybe there is something in this link that could help: enter link description here
2 Comments
Janu
Ye I would like to do something like familyList = {"Mother": {}, "Father": {} }, is that possible?
mamadou jallow
Yes that is very possible
{ }then it's not a list, it's an object.[...], objects are{...}