title: Javascript: Best way to convert associative array to string and back the other way later?
body: <p>I have an associative array as follows:</p>
  
  <pre><code>var AssocArray = { id:0, folder:'Next', text:'Apple' };
  </code></pre>
  
  <p>Now I need to store this in a database, so I figure I would just convert this into a string, store it in the database and then pull it out of the database and put it back into a javascript array later on.</p>
  
  <p>The catch is that the actual  # of items, and the array variables will be different every time (hence why I wanted to store it as one long string instead).</p>
  
  <p>What’s the best way to convert this associative array into a string, and then also vice versa, how to convert a string into an associative array?</p>