Jscript enforcing variable definition

Trace:
XLog is what I use: Helper: XLog (versatile logging approach for DO scripting)

Dump:
To dump regular variables, XLog or just DOpus.Output("MyVar: + MyVar) should be fine.
To recusively dump js-objects and arrays, I use this function:

[code]///////////////////////////////////////////////////////////////////////////////
function DumpObject(o, name, upperCaseProps, self, level){
this.version = 0.4;
name = name || "unnamed";
if (self == undefined)
DOpus.Output("DumpObject(): ["+name+"]");
var maxLen = 0;
upperCaseProps = upperCaseProps || false;
self = self || false;
level = level || " ";

for(prop in o)
	if (prop.length > maxLen) maxLen = prop.length;

for(prop in o) {
	var pad = ""; while (pad.length+prop.length<maxLen) pad+=" ";
	propName = (upperCaseProps?prop.toUpperCase():prop);
	if (!o.hasOwnProperty(prop))
		continue;
	switch(typeof o[prop]) {
		case "function":
			DOpus.Output(level+propName+pad+": function(){}..");
		break;
		case "object":
			DOpus.Output(level+propName+pad+": "+o[prop]);
			DumpObject(o[prop], propName, upperCaseProps, false, level+"    ");
		break;
		default:
			DOpus.Output(level+propName+pad+": "+o[prop]);
	}
}

}[/code]
Use like that:

var myObj = {name: "MyName", print: function(a){ DOpus.Output(a); }}; DumpObject(myObj, "MyObj");
Breakpoints:
There once was the windows script debugger, but I doubt it's working in DOs context and also don't know if it's still available in recent windows versions, haven't used it for ages. Maybe you like to have some research on this on your own. I somehow get along without that - in DO jscript(ing) at least.

Defining:
As already told, nope.