let common = {
"id": 1364184,
"url": "http:\/\/www.tvmaze.com\/episodes\/1364184\/the-big-bang-
theory-11x12-the-matrimonial-metric",
"name": "The Matrimonial Metric",
"season": 11,
"number": 12,
"airdate": "2018-01-04",
"airtime": "20:00",
"airstamp": "2018-01-05T01:00:00+00:00",
"runtime": 30,
"image": {
"medium": "sonie",
"original": "agarwal"
},
"summary": "<p>To discover who would be most qualified to be best
man and maid of honor at their wedding, Sheldon and Amy subject
their friends to a series of secret experiments. Also, Penny
reveals her true feelings about Amy.<\/p>",
"_links": {
"self": {
"href": "http:\/\/api.tvmaze.com\/episodes\/1364184"
}
}
}
for (var x in common) {
console.log(x+ "=" +common[x]);
if ( x === "image" ){
let z = common.image
for (var y in z) {
console.log( x + " = " + y+ " : " +z[y]);
}
}if ( x === "_links" ){
let z = common._links.self
for (var y in z) {
console.log( x + " = " + y+ " : " +z[y]);
}
}
}
i wrote maximum of the code for getting output but what i want is, get rid of some output which is boxed with black color which is shown in the figure. so please help me with that...
imageis not "deeply nested", it's a property of the object. Why can't you just use:let z = common.imagewithout the loop? And what do you mean by "get rid of some output"? Do you want to delete some properties for the object?