Tutorial Print Object To Screen

PHP has a nice print_r function for printing out information about a variable to the screen. console.log() is great for that in JavaScript a...

PHP has a nice print_r function for printing out information about a variable to the screen. console.log() is great for that in JavaScript also, but sometimes you just need/want to look at it on the screen.
function print_r(o) {
return JSON.stringify(o,null,'\t').replace(/\n/g,'
').replace(/\t/g,'   ');
}
So if you have an object like:
var myObject = {
"lunch": "

Hot in Week

Popular

Archive

item