JavaScript: What's global object and where does "this" refer to?
<p>I've learned that in function invocation, <code>this</code> would refer to the global object. In the function below, which is the global object?</p>

<p>Is it the Function or there's a single default global object where <code>this</code> would refer to? In addition to that, what does this code actually do? I am particularly confused about the <code>method</code> placeholder. Does it have to be replaced with a method that's pre-existing in Function.prototype?</p>

<p>And in the line <code>this.prototype[name] = func;</code>, which property is it referring to, the method's or the Function.prototype's?</p>

<pre><code>Function.prototype.method = function (name, func) {
    this.prototype[name] = func;
    return this;
};
</code></pre>
