uvinod uvinod - 9 months ago 37
Javascript Question

How to print object array in javascript?

I have created an object array in javascript. My question is how to print the object array in the browser window like print_r function in php. Thanks advance.

var lineChartData = [{
date: new Date(2009, 10, 2),
value: 5
}, {
date: new Date(2009, 10, 25),
value: 30
}, {
date: new Date(2009, 10, 26),
value: 72,
customBullet: "images/redstar.png"


There is a wonderful print_r implementation for JavaScript in php.js library.

Note, you should also add echo support in the code.

DEMO: http://jsbin.com/esexiw/1