Skip to content

Instantly share code, notes, and snippets.

@willzfrank
Forked from prof3ssorSt3v3/7-closure.js
Created April 20, 2022 11:45
Show Gist options
  • Save willzfrank/fa05350a3140cb746c6de0354280ed8d to your computer and use it in GitHub Desktop.
Save willzfrank/fa05350a3140cb746c6de0354280ed8d to your computer and use it in GitHub Desktop.
function f1(a) {
let b = 2;
setTimeout(function () {
console.log(a, b)
}, 1000);
}
function f2() {
for (var i = 0; i < 3; i++) {
setTimeout(function () {
console.log(i)
}, 1000 * i);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment