Q: 3
Given the following code:
01 counter = 0;
02 const logCounter = () => {
03 console.log(counter);
04 };
05 logCounter();
06 setTimeout(logCounter, 2100);
07 setInterval(() => {
08 counter++;
09 logCounter();
10 }, 1000);
What will be the first four numbers logged?
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.