Skip to content

Instantly share code, notes, and snippets.

@mauricedb
Last active August 29, 2015 14:02
Show Gist options
  • Save mauricedb/5db91094f5852d9c080c to your computer and use it in GitHub Desktop.
Save mauricedb/5db91094f5852d9c080c to your computer and use it in GitHub Desktop.
X things every JavaScript developer should know: scoping - Wrong
var text = "Hello from script 1";
setTimeout(function () {
console.log(text);
}, 1000);
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