So I have a JSON variable that looks like this:
var peopleList = {
"1": {"Name": "Lisa", "item1": "Name of Item 1"} ,
"2": {"Name": "Marty"} ,
"3": {"Name": "Jordan", "item1":"Name of Item 1", "item2":"Name of Item 2"}
}
I guess it's kind of like a relational database.
Basically for the scope of the program i'm trying to do I need to be able to keep adding in multiple people (1-3 in this variable) and then associate multiple items to those people.
Also for the variable as it is now i'm not even sure what the getters and setters would be in Javascript.
For example, how would I add an item to "Marty"
And how would I print out the Name for item2 from person "Jordan"
Thanks for any help. I'm still a little bit new to JSON.
And if there is a better way to do this that is easier to parse, i'm all ears.