I don't understand how this javascript function executes
<p>When I run the following codes, the alert popup displays undefined. I thought it would return either true or false instead. Please can someone explain how the checkLoginStatus() function excutes. Thanks.</p>

<pre><code>function checkLoginStatus() {
$.get("func.php", {op:'login_status', r:Math.random()}, function(data) {
    if (data == "Yes") {
        showSalesView();
        return true;
    } else {
        loginView();
        return false;
    }   
});
</code></pre>

<p>}   </p>

<pre><code>alert(checkLoginStatus());
</code></pre>
