Skip to content

Instantly share code, notes, and snippets.

Waldecir Faria wfaria

Block or report user

Report or block wfaria

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hallettj
hallettj / global-variables-are-bad.js
Created Feb 14, 2009
How and why to avoid global variables in JavaScript
View global-variables-are-bad.js
// It is important to declare your variables.
(function() {
var foo = 'Hello, world!';
print(foo); //=> Hello, world!
})();
// Because if you don't, the become global variables.
(function() {
You can’t perform that action at this time.