Local variables


#1

Hi,
I have seen around 3 links relating local variables and global variables.I have a doubt i.e why don’t we declare local variables inside a block.I understand they are in the functions block.Are they temporary i.e they run as long as they are in the block or something.I need a clear explanation,Please explain.
Thanks


#2

== discussions / opinions ==
Do a google search like
javascript function scope explained site:stackoverflow.com
and read some articles…

You could also use
javascript local scope vs global scope site:stackoverflow.com

OR

== the Book ==
scope site:developer.mozilla.org/en-us/


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.