Access Nested Object Dynamically Javascript Interview Programming