View Single Post
Old 07-14-2011, 07:06 PM   PM User | #4
DaveyErwin
Regular Coder

 
Join Date: Aug 2010
Posts: 810
Thanks: 12
Thanked 168 Times in 166 Posts
DaveyErwin is on a distinguished road
Code:
var a = 'A';
var b = 'B';

test = (function(t){
     alert(t);
     alert(b);
})(b);


alert(test)
//test(a);
Test will equal the return value
of the anonymous function, in
this case there is no reurn value
so test is undefined.
DaveyErwin is offline   Reply With Quote