title: Get value where variable name stored in another variable
body: <p>Without using eval ... I'm trying to see if I can get a value from a variable where the value is stored in another variable. Such as get value of 'ValueC' from varA where varA='varB' and varB='ValueC'</p>
  
  <p>The user will enter a string, simulated below as the variable named 'UserSpecified'.  They could enter any character and if doesn't match an existing variable ... well I'll just return null.</p>
  
  <p>I realize I can do this with an eval(), but evals seem to be frowned upon I'm trying to do it in a better way.</p>
  
  <p>I've tried the ES2015+ accepted answer from <a href="https://stackoverflow.com/questions/5187530/variable-variables-in-javascript">&quot;Variable&quot; variables in Javascript?</a> but I'm not having any success.  Am I missing something or should I stick with an eval?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let a  = "aye";
  let b = "be";
  let c = "sea";
  
  let userSpecified="a";
  let obj = {userSpecified};
  let parm='userSpecified';
  
  console.log(eval(userSpecified));  // This displays 'aye'
  
  console.log(obj[parm]); // This displays 'a' but I would like it to display 'aye'</code></pre>
  </div>
  </div>
  </p>