Created
April 11, 2022 16:11
-
-
Save Avi-E-Koenig/0c3b47849231df177a7d4dff707b6317 to your computer and use it in GitHub Desktop.
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
function initTimer() { | |
let timer = 0; | |
let interval = setInterval(() => { | |
timer++; | |
console.log("๐ ~ file: main.js ~ line 5 ~ interval ~ timer", timer) | |
if (timer === 10) { | |
clearInterval(interval); | |
console.log('Time is up!'); | |
} | |
}, 1000); | |
} | |
console.log("๐ ~ file: main.js ~ line 5 ~ initTimer", initTimer) | |
initTimer() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment