How global scope works in javascript : <pre><code> var a = 10
 function fun(){
     var b = 20
 }
fun()
</code></pre>

<p>In this code var a has global scope but var b dont have global scope but functional scope. But as fun() itself is global function which will be global to everywhere why var b is not global</p>
