Created
June 11, 2025 02:14
-
-
Save ORESoftware/570e39044a09c0b1f4e4947576dd4940 to your computer and use it in GitHub Desktop.
the closure example was not correct
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let i = 0; | |
const v = () => { | |
setInterval(() => { | |
console.log({i}); | |
}, 200); | |
setInterval(() => { | |
i++; | |
}, 900); | |
} | |
v(); | |
// you will see i increases with logging |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment