The situation is somewhat like-
var someVar = some_other_function(); someObj.addEventListener(\"click\", function(){ some_function(someVar); }, false); <
Here's yet another way (This one works inside for loops):
var someVar = some_other_function(); someObj.addEventListener("click", function(theVar){ return function(){some_function(theVar)}; }(someVar), false);