I am studying json and i was wondering if this is the right way to write a multi dimensional json object that is nested.I wrote:
var foo = {
\"logged_in\":tr
That's not actually an array that you have there, that's just an object containing properties that are also objects. You're also missing a few commas so this won't even compile.
What might be more convenient for you in this case is to use both arrays and objects to form your JSON. For Example:
var this_json_string = {
"state":"Ohio",
"country":"USA",
"products":[
{
"pic_id":"1500",
"description":"Picture of a computer",
},
{
"pic_id":"15011",
"description":"Picture of a cpu"
},
{
"pic_id":"15012",
"description":"Picture of a cpu two"
},
{
"pic_id":"1501",
"description":"Picture of a cpu"
}
]
};