title: Create JSON string from javascript for loop
body: <p>I want to create a JSON string from a javascript for loop. This is what I tried to do (which gives me something that looks like a JSON string), but it does not work.</p>
  
  <pre><code>var edited = "";
  for(var i=1;i&lt;POST.length-1;i++) {
      edited += '"'+POST[i].name+'":"'+POST[i].value+'",';
  }
  </code></pre>
  
  <p>It gives me this:</p>
  
  <pre><code>"type":"empty","name":"email-address","realname":"Email Address","status":"empty","min":"empty","max":"empty","dependson":"empty",
  </code></pre>
  
  <p>This does not work if I try to convert it into a JSON object later.</p>