<!-- An example for use on Netscape only --> <HTML> <HEAD> <SCRIPT> function object_dump(anObject) { document.write("<HR>"); document.write("<TABLE BORDER=1>"); table_row("<B>Item</B>", "<B>Value</B>"); if(typeof anObject != "object") { table_row("Value", anObject); table_row("Typeof", typeof(anObject)); } else { table_row("Value", anObject.valueOf()); table_row("String equiv", anObject.toString()); table_row("Typeof", typeof(anObject)); table_row("Class", anObject.constructor.name); table_row("Prototype", anObject.prototype); } document.write("</TABLE>"); document.write("<HR>"); } function table_row(anItem, aName) { document.write("<TR>"); document.write("<TD>"); document.write(anItem); document.write("</TD>"); document.write("<TD>"); document.write(aName); document.write("</TD>"); document.write("</TR>"); } </SCRIPT> </HEAD> <BODY> <SCRIPT> function nest(abc) { test("aa", bb, 100); } function test(aa, bb, cc, dd) { object_dump(aa); object_dump(bb); object_dump(cc); object_dump(arguments.caller.callee.name); object_dump(arguments.callee.constructor.name); } var bb; nest("aa", bb, 100); object_dump(document); </SCRIPT> </BODY> </HTML>
See also: | Arguments object, Debugging - client-side, typeof |
Prev | Home | Next |
Object constant | Up | Object literal |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |