scope in javascript (why at the scope of $.post() method array is local?)
<pre><code>externalCSSContents = [];

function getExternalCSSContents(){
        href = document.styleSheets[0].href;
        $.post(href, function(result){
            externalCSSContents.push(result);
            alert(externalCSSContents.length); // 1
        });
}

getExternalCSSContents();
alert(externalCSSContents.length); // 0
</code></pre>

<p>Can someone please explain to me why at the scope of $.post() method array externalCSSContents is local?</p>
