title: JavaScript convert a string to a variable name?
body: <p>I have a JavaScript like this:</p>
  
  <pre><code>var metFital = { "IMP_TRAV_SP": { type: "cont", Est: 0.055 },....}
  var IMP_TRAV_SP= 20;
  
  var EvalueFital=0
    for (var par in metFital) {
       if (metFital[par].type == "cont") {
              EvalueFital = EvalueFital + ((metFital[par].Est) *par);
          }
  };
  </code></pre>
  
  <p>I want to loop through the object "metFital", to get the "Est". Then calculate "Est"*par. </p>
  
  <p>For instance when par="IMP_TRAV_SP"(first iteration of the loop), then I can get the value of Est*IMP_TRAV_SP. How should I write the stuff under the if statement?</p>