title: Parse JSON values as javascript object literals
body: <p>I have a rest service that creates me some typescript code like this: </p>
  
  <pre><code>var parametrosUpdate = {
  "compania": "this['variable_COMPANIA']",
  "elemento": "this['variable_ELEMENTO']",
  "serie": "this['variable_SERIE']"
  };
  </code></pre>
  
  <p>However, i have a variable called variable_COMPANIA, and i need to 
  parse the json as follows: </p>
  
  <pre><code>var variable_COMPANIA = 'value here';
  
  var parametrosUpdate= {
  "compania": this['variable_COMPANIA'],
  "elemento": this['variable_ELEMENTO'],
  "serie": this['variable_SERIE']
  };
  </code></pre>
  
  <p>So, basically i need to parse the json to a object literal to use properly as a javascript var.</p>
  
  <p>I have tried already the JSON.parse() function but it doesn't worked to me.</p>