I am trying to wrap my brains around the fact that something
equals the value of the returned anonymous function value. I thought with scoping it wouldn't have had access to the functions variables.
So how does calling something
give you the value of 3?
function somefun (x){
return function(){
return x;
}
}
var something = somefun (3);
something();
//3