Skip to content

Instantly share code, notes, and snippets.

@cawel
Created March 12, 2018 19:30
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 cawel/30f4f33693b7c1df3a49a347cf41533b to your computer and use it in GitHub Desktop.
Save cawel/30f4f33693b7c1df3a49a347cf41533b to your computer and use it in GitHub Desktop.
javascript-interview-question-4.js
const operations = []
for (var i = 0; i < 5; i++) {
operations.push(() => {
console.log(i)
})
}
for (const operation of operations) {
operation()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment