What value is obtained when executing the following code?
function createCounter() {
let counter = 0;
function increaseCounter() {
return ++counter;
}
return increaseCounter;
}
const count = createCounter();
console.log(count());
What value is obtained when executing the following code?
function createCounter() {
let counter = 0;
function increaseCounter() {
return ++counter;
}
return increaseCounter;
}
const count = createCounter();
console.log(count());