Printing JavaScript objects three ways

Found these useful:

//method 1

console.log(obj);

//method 2

var output = ‘’;

for (var property in obj) {

output += property + ‘: ‘ + object[property]+’; ‘;

}

//method 3

s = JSON.stringify(obj);</code>

Thanks

tags: & category: -