Is there a parameter and the "Bunch of code" returns a function?
var a = function(x) { return function() { document.write(x); } }(something);
Closure. The value of something
gets used by the function assigned to a
. something
could have some varying value (for loop) and every time a has a new function.