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