title: How to get an object value, which property is equal to a variable value
body: <p>Please help me to solve the task below.</p>
  
  <p>I want to display an object value, which property is equal to the variable txt. If <code>txt = "my location"</code>, I want to display the value of “my location”.</p>
  
  <p>And also I want to display it in such way:</p>
  
  <p>city: value1,</p>
  
  <p>street: value2</p>
  
  <pre><code>var obj = {“my name”: “first second”, “my location”: {“city”: “value1”, “street”: “value2”}};
  objkeys = Object.keys(obj);
  for (var i = 0; i &lt; objkeys.length; ++i) console.log(objkeys[i]);
  var txt = “my location”;
  if (txt === objkeys[i]) console.log(???)
  </code></pre>
  
  <p>What should be written instesd of ???</p>
  
  <p>Thanks!</p>