in reply to Declaring variables under 'use strict'
I applaud your desire to want to learn proper variable scoping. It may take a bit of reading and re-reading until it "clicks", but once it does it will be well worth it (meaning your code will be easier to read, debug, and maintain).
To understand variable scoping, you need to understand the difference between lexical variables and global variables. There are many excellent resources to help you, including:
Please take a look at some of those references. If you have specific questions, feel free to ask. Sorry for only posting links, but those references describe lexical scoping far better than I could and I'd only be repeating what they already say.
|
|---|