title: Why are closures better than global variables for preserving variables?
body: <p>I understand how closures work within JavaScript, but my question is why would you go through all the trouble of making a closure to preserve a variable? Couldn't you just make the variable global? Or would that clutter up the global scope and make your code be prone to errors.</p>