Why write ".call(this)" at the end of an javascript anonyms function?
<p>I have seen javascript written like this (it was at a demonstration, and I don’t have the actual code to hand, but it was implied this was normal):</p>

<pre><code>(function() {    

    var a = 1;

    this.sayA = function() {
        alert(a);
    }

}).call(this);

sayA();
</code></pre>

<p>I suppose it is written in an anonyms function so that the variable "a" is not globally available.</p>

<p>What could the point of the ".call(this)" be?  Since this function was not nested, "this" was just the window.  How does it differ from just writing () at the end?</p>

<p>Thanks</p>
