var NS = ( function ( window, document ) {
// ... snip
var g_debug;
function test( value )
{
g_debug = value;
}
return {
test: test
}
} ( window, document ) );
var NS = ( function ( window, document ) { // … snip var
Share
This:
does not call the function. That’s just a reference to the function, and the console will print the function source as the value of your console command.
When you write:
in the console, the console prints the return value from the function. Since the function has no
returnstatement, it’s alwaysundefined.You should probably declare
g_debugwithvarsomeplace if you haven’t.