Local variables


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.


== 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


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


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