- A variable aaa declared outside of a function is global.
- If a function f1 declares a aaa variable in its code using var, all modifications made to this variable is local and the global aaa variable is not impacted.
- If one uses the f1 local aaa variable in f1 code before it is declared, Javascript will consider it undefined.
- If a function f2 does not declare a local aaa variable in its code, it can access the global aaa variable by using its name. All modifications are registered in the global variable.
- Passing a global variable as a parameter to a function, and modifying this parameter inside that function does not modify the global variable.
Tips & Tricks, Summaries, Check Lists, Do's & Don'ts, Reminders, Stuff that works...
Showing posts with label Variables. Show all posts
Showing posts with label Variables. Show all posts
Wednesday, 2 January 2013
Javascript Variable Scope Caveats
I ran into a strange Javascript variable scope issue. I am not satisfied with the documentation I found so far, hence this post:
Labels:
Java,
Javascript,
Scope,
Variables
Sunday, 16 September 2012
Accessing Environment And System Variables On Windows 7
This is a reminder describing how to access environment and system (including path) variables under Window 7:
- Open Windows Explorer.
- On the left part of the screen, select the Computer icon.
- Right-click this icon and select properties.
- A window will open, select Advanced System Settings.
- A System Properties windows will open.
- At the bottom, click Environment Variables.
Subscribe to:
Posts (Atom)