Access Nested Object Dynamically Javascript Interview