Object Inside Object in JS
<script>
let user = {
name: “Shairy”,
sizes: {
height: 182,
width: 50,
},
getData: function () {
alert(“hello”);
},
showData() {
alert(this.name + this.sizes.height);
},
};
user.getData();
user.showData();
alert(user.sizes.width);
</script>
Well explanied