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