Here you can find the source of dump()
Array.prototype.dump = function () { for (var element in this) { print(element, this[element]); }/*from w w w. j a v a 2s . c o m*/ }; var custom = ['1', 2, "three"]; custom.dumper = function () { print("something"); }; custom.dumper(); custom.dump();
Array.prototype.dump = function(){ var output = new Array(); var number = 0; output.push('<tr><th>#</th><th>Key</th><th>Value</th></tr>'); for(var i in this){ if(typeof eval(this.get(i)) != 'function'){ output.push('<tr><td>' + number + '</td><td>' + i + '</td><td>' + this.get(i) + '</td></tr>'); number++; return 'Array dump: <table>' + String.fromCharCode(10) + output.join(String.fromCharCode(10)) + String.fromCharCode(10) + '</table>';