title: Do closures in Javascript get a reference to the full outer function or do they only get references to the variables they actually use?
body: <p>Just out of curiosity, do closures in JavaScript get a reference to the whole "outer environment", or is the returned function analyzed to see which variables in the outer scope it references and then only gets references to those?</p>