Two counters are created by the same factory. What does this code log?
function createCounter() {
let count = 0;
return function () {
count += 1;
return count;
};
}
const a = createCounter();
const b = createCounter();
console.log(a());
console.log(a());
console.log(b());
console.log(a());