convert string to dynamic array with variables in javascript
<p>How would I take a string (that I got from a page using jQuery's text()) such as:</p>

<pre><code>var myData = "[{name:'xxx',data:[1,2,3,4,5]},{name:'yyy',data:[5,4,3,2,1]}]"; //this is a string :(
</code></pre>

<p>And turn it into the actual javascript object that I need, so for example:</p>

<pre><code>var myObject = [{name:'xxx',data:[1,2,3,4,5]},{name:'yyy',data:[5,4,3,2,1]}];
</code></pre>

<p>So 'name' and 'data' will be non-dynamic variables, however names value, the data array and the length of myObject will be dynamic.</p>

<p>Not really sure where to start with this one. I am guessing that I will have to do a whole lot  of spliting and looping, but I am open to suggestions.</p>
