Exam4Training

What is logged by the first four log statements?

Given the following code:

Counter = 0;

const logCounter = () => {

console.log(counter);

);

logCounter();

setTimeout(logCOunter, 1100);

setInterval(() => {

Counter++

logCounter();

}, 1000);

What is logged by the first four log statements?
A . 0012
B . 0123
C . 0112
D . 0122

Answer: C

Exit mobile version