What is best practice to get a variable outside of its anonymous function without polluting the global namespace?

Edit
Report