title: Javascript object to formatted string
body: <p><strong>How to output an object as a readable string with formatting (structured like with <code>&lt;pre&gt;</code>) ?</strong></p>
  
  <p>No jQuery possible.</p>
  
  <p>My object looks like this using <code>console.log</code>.</p>
  
  <pre><code>Object
     title: "Another sting"
     type: "tree"
     options: Object
        paging: "20"
        structuretype: "1"
     columns: Object
        ...
     description: "This is a string"
     ...
  </code></pre>
  
  <p>What is the best to convert it to a structured string?</p>
  
  <p><strong>My attempt:</strong></p>
  
  <p>I tried using <code>stringify()</code> to get the JSON structure. I could then write my own parser, but maybe there are already any implementations?</p>