Skip to content

Instantly share code, notes, and snippets.

@penartur
Created August 3, 2012 12:16
Show Gist options
  • Save penartur/3247071 to your computer and use it in GitHub Desktop.
Save penartur/3247071 to your computer and use it in GitHub Desktop.
(function () {
for (var i = 1; i < 3; i++) {
var x;
console.log(i + ": " + x);
x = i;
console.log(i + ": " + x);
}
}());
@penartur
Copy link
Author

penartur commented Aug 3, 2012

outputs

1: undefined
1: 1
2: 1
2: 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment