On Jul 13, 2007, at 20:53 , Stephan Beal wrote:

As i understand it, that code is wrong, as globVar.innerFun2() is not
available to the caller at this point. IMO, to be legal code,
"innerFun2()" should be replaced with "outerFun2()".

See: http://javascript.crockford.com/private.html

for why innerFun2() can be considered a "private" variable of globVar.

What you're missing here is the return statement of the outer function. A reference to the inner function is returned, so it can be called by the outside code.

--
Jonathan Chaffer
Technology Officer, Structure Interactive


Reply via email to