- If we don't put var keyword variable becomes global.
- If we write "use strict " , variable must be declared before use
- JavaScript can pull and reorganize variable declaration (javascript hoisting)
alert(x);
var x=10;
above two lines throws undefined exception

No comments:
Post a Comment