title: Is there a toString-like function for javascript objects?
body: <p>While debugging and developing with javascript, I often wanted to alert the objects, so I used the below code:</p>
  
  <pre><code>for(a in obj)
  {
    alert(a +' = '+obj[a])
  }    
  </code></pre>
  
  <p>It serves well, but it is too annoying. I want to know if there is anything just like this for arrays:</p>
  
  <pre><code>var temp = ['a','b','c'];
  alert(temp); // it will alert a,b,c 
  </code></pre>
  
  <p>So what I wish to do is:</p>
  
  <pre><code>var temp = {a:'a',b:'b',c:'c'};
  alert(temp) ; // It should alert json {a:'a',b:'b',c:'c'}
  </code></pre>
  
  <p>Or any other better suggestion so I could look up the object easily.</p>