Skip to content

Instantly share code, notes, and snippets.

@mauricedb
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mauricedb/a167fec15ea1c5c254e6 to your computer and use it in GitHub Desktop.
Save mauricedb/a167fec15ea1c5c254e6 to your computer and use it in GitHub Desktop.
X things every JavaScript developer should know: scoping - Right
(function() {
var text = "Hello from script 1";
setTimeout(function () {
console.log(text);
}, 1000);
}());
(function() {
var text = "Hello from script 2";
setTimeout(function () {
console.log(text);
}, 1000);
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment