1//common way
2console.log(object);
3
4//for non-browser srcipts
5console.log( JSON.stringify(object, null, 2) ); // spacing level = 2
1function dump(obj) {
2 var out = '';
3 for (var i in obj) {
4 out += i + ": " + obj[i] + "\n";
5 }
6alert(out);
7}