If this is for debugging purposes, I would advise you use a JavaScript debugger such as Firebug. It will let you view the entire contents of arrays and much more, including modifying array entries and stepping through code.
EDIT: Firefox and Google Chrome now have a built-in JSON object, so you can just say alert(JSON.stringify(myArray)) without needing to use a jQuery plugin. This is not part of the Javascript language spec, so you shouldn't rely on the JSON object being present in all browsers, but for debugging purposes it's incredibly useful.
However, for debugging your Javascript code, I highly recommend Firebug It actually comes with a Javascript console, so you can type out Javascript code for any page and see the results. Things like arrays are already printed in the human-readable form used above.
Firebug also has a debugger, as well as screens for helping you view and debug your HTML and CSS.
If what you want is to show with an alert() the content of an array of objects, i recomend you to define in the object the method toString() so with a simple alert(MyArray); the full content of the array will be shown in the alert.
Here is an example:
//-------------------------------------------------------------------
// Defininf the Point object
function Point(CoordenadaX, CoordenadaY) {
// Sets the point coordinates depending on the parameters defined
switch (arguments.length) {
case 0:
this.x = null;
this.y = null;
break;
case 1:
this.x = CoordenadaX;
this.y = null;
break;
case 2:
this.x = CoordenadaX;
this.y = CoordenadaY;
break;
}
// This adds the toString Method to the point object so the
// point can be printed using alert();
this.toString = function() {
return " (" + this.x + "," + this.y + ") ";
};
}
Then if you have an array of points:
var MyArray = [];
MyArray.push ( new Point(5,6) );
MyArray.push ( new Point(7,9) );