When you have an object with multiple nested properties and you must "navigate" its interiors to reach what you want to get, like:
var innerProperty = obj[level1][level2][level3];
maybe you will get undefined when reaching level 2, so the next level, undefined[level3], will halt your code with an error.
The correct way is to check if every level exists before attempting to reach the next one, but code will start to become clumsy:
if (obj[level1] && obj[level1][level2]) {
var innerProperty = obj[level1][level2][level3];
}
Then, again, you must check if innerProperty is undefined.
What is the best way to deal with this, keeping the code clean and not needing to repeat the nested level names inside each if clause you use?