The beauty of javascript is, that it allows you to dynamically add behaviors and states in an object at runtime . So an object can have more properties than what was mentioned during the declaration. It even allows you to dynamically update an object's prototype chain. So all other objects of the same type get access to these updated behaviors or states. The Problem To support this dynamic addition feature, Javascript allows us to write code that accesses any random property on an object with a ( . ) operator. It does not verify if that property should be accessed or not. For example, If you have a Vehicle , which can be any valid vehicle, like a car, airplane, bike, ship, etc. then in a badly designed codebase, you can encounter the below code. let flightDuration = vehicle.flightDetails.duration Let's assume the vehicle object we are dealing with, is a Car, In 2022 it's fair to assume that a car can not fly. For a car the expression...
Explore more at my website