Skip to content

Instantly share code, notes, and snippets.

@mahdavipanah
Last active April 16, 2021 10:58
Embed
What would you like to do?
const called = (function () {
let count = 0
return () => {
count++
console.log(`Called: ${count}`)
}
})()
called() // Called: 1
called() // Called: 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment