What does the global in (function(global){ some code .. })(this) do?
<p>I was looking at adding comments to JSON and found <a href="https://github.com/getify/JSON.minify/blob/master/minify.json.js" rel="nofollow">this script</a> that strips them out before processing making the JSON valid.  I am just trying to understand how it works to make the JSON.minify() function available?</p>

<p>It starts with</p>

<pre><code>(function(global){ ...
</code></pre>

<p>totally which is weird to me.  I found that "<a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/RegExp/global" rel="nofollow">global is a property of a RegExp instance, not the RegExp object</a>" on MDN but I don't understand how it is works in this script if at all.</p>
