getValueobjOrNull
getValueobjOrNull is a JavaScript function designed to safely retrieve a property value from a potentially nested object. Its primary purpose is to prevent runtime errors that can occur when trying to access properties of null or undefined values. The function takes an object and a path (represented as a string or an array of strings) as arguments. It then traverses the object according to the provided path. If at any point during the traversal it encounters a null or undefined value, it immediately returns null instead of throwing an error. If the path is valid and the property exists, it returns the corresponding value. This utility is particularly useful in scenarios where data structures are dynamic or come from external sources, making it difficult to guarantee the existence of all intermediate properties. It simplifies code by avoiding multiple `if` checks or the use of the optional chaining operator (`?.`) in older JavaScript environments. The function typically accepts an optional default value that is returned if the final property is not found or if an intermediate value is null or undefined.