Setting the scope of a callback to where it is executed?
<p>I'm trying to understand why this alerts to true? And how I would be able to alert false without passing arguments to the callback function (if possible)?</p>

<pre><code>var a = true;

function foo(callback){
    var a = false;
    callback();
}

function bar(){
    alert(a);
}
foo(bar); // Alerts true
</code></pre>
