JSON object can have another JSON object as a child
var myObj = {
    "name":"John",
    "age":30,
    "cars": {
        "car1":"Ford",
        "car2":"BMW",
        "car3":"Fiat"
    }
}

// Accessing nested object properties
document.write(myObj.cars.car2);
document.write("<br />");
document.write(myObj.cars["car2"]);
document.write("<br />");
document.write(myObj["cars"]["car2"]);
by Valeri Tandilashvili
4 years ago
JSON
JavaScript
JS JSON
2
Pro tip: use ```triple backticks around text``` to write in code fences