Return nested object property

Write a function that takes an object as an argument. In some cases, the object contains other objects with some deeply nested properties. Return the property 'b' of object 'a' inside the original object if it exists. If not, return undefined.
JavaScript
Console