Result Size: 300 x 150
x
 
<!DOCTYPE html>
<html lang='uk'>
<body>
<h2>Доступ до вкладених об’єктів JavaScript</h2>
<p id="demo"></p>
<script>
const myObj = {
  "name":"John",
  "age":30,
  "cars": {
  "car1":"Ford",
  "car2":"BMW",
  "car3":"Fiat"
  }
}
document.getElementById("demo").innerHTML = myObj.cars.car2;
</script>
</body>
</html>