title: Saving javascript objects as strings
body: <p>This is for a gaming application.
  In my game I want to save special effects on a player in a single field of my database.  I know I could just put a refrence Id and do another table and I haven't taken that option off the table.
  Edit: (added information) This is for my server in node not the browser.</p>
  
  <p>The way I was thinking about storing the data is as a javascript object as follows:</p>
  
  <pre><code>effects={
             shieldSpell:0,
             breatheWater:0,
             featherFall:0,
             nightVision:0,
             poisonResistance:0,
             stunResistance:0,
             deathResistance:0,
             fearResistance:0,
             blindResistance:0,
             lightningResistance:0,
             fireResistance:0,
             iceResistance:0,
             windResistance:0}
  </code></pre>
  
  <p>It seems easy to store it as a string and use it using effects=eval(effectsString)
  Is there an easy way to make it a string or do I have to do it like:</p>
  
  <pre><code>effectsString=..."nightVision:"+effects.nightVision.toString+",poisonResistance:"+...
  </code></pre>