0
do we require to declare that a particular variable is a var? Because, even without declaration the j.s. code runs
4 Answers
+ 4
@2+2=4, Global scope means that you can access the variable anywhere in the program!
0
whats that global scope mean?
0
ty. But I still not getting it. can u explqin it with a simple example, since Iam still a beginner
0
i understood now, whats globalscope and local scope. thanks a lot.
But, even though we write 'var a=something' or 'a=something' . both will be global if we write it above all.Then is there any use of using var.
I practised ur code.
Ur challenge:when a same var is used for local as well as global scope, for a particular function where the local var is used, local value will work there even though global value is different.