title: Convert string to nested array
body: <p>I have a string passed from server which was called with AJAX and I have to convert the string into a nested array which will be used to populate on PDF. </p>
  
  <p>For example:</p>
  
  <pre><code>var tableData = "[{ name: 'Bartek', age: 34 },{ name: 'John', age: 27 },{ name:'Elizabeth', age: 30 }]";
  </code></pre>
  
  <p>and I need to convert into an array in JavaScript which will be like this:</p>
  
  <pre><code>var newTableData = [
      { name: 'Bartek', age: 34 },
      { name: 'John', age: 27 },
      { name: 'Elizabeth', age: 30 }
  ];
  </code></pre>
  
  <p>How can I do that?</p>