title: Convert object's properties and values to array of key value pairs
body: <p>I'm fairly new to JavaScript and am not sure this is possible to do but basically I would like to take an object and convert it into an array of strings in the format; <code>array[0] = 'prop1=value1'</code></p>
  
  <p>The reasoning behind this is that I'm having a user enter a list of k=v pairs into a form, later it's written as an object within a json blob. Going from the key value csl to the json object was simple, now I need to go back the other way (I've received the JSON via an ajax call and want to populate a blank form). Is this possible in JavaScript? If not please offer a reasonable work around.</p>
  
  <p>Sample code;</p>
  
  <p>Object in debugger;</p>
  
  <pre><code> Object
          private_key: "private-key"
          public_key: "public-key"
  </code></pre>
  
  <p>I need to convert that to;</p>
  
  <pre><code> "private_key=private-key,public_key=public-key"
  </code></pre>
  
  <p>Basically I need something like this (pseudo code)</p>
  
  <pre><code>var outputString = '';
  foreach (prop in obj)
  {
      outputString = outputString + prop.tostring() + '=' + prop.value + ',';
  }
  </code></pre>