Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.