title: Is it possible to restrict the scope of a javascript function?
body: <p>Suppose I have a variables in the global scope.</p>
  
  <p>Suppose I wish to define a function which I can <em>guarantee</em> will not have access to this variable, is there a way to wrap the function, or call the function, that will ensure this?</p>
  
  <p>In fact, I need any prescribed function to have well defined access to variables, and that access to be defined prior to, and separate from that function definition.</p>
  
  <p>Motivation:
  I'm considering the possibility of user submitted functions. I should be able to trust that the function is some variety of "safe" and therefore be happy publishing them on my own site.</p>