Question 5
Consider the below JavaScript program.
function outer() { let count = 0; return function inner() { return ++count; };}
const counter1 = outer();const counter2 = outer();
console.log(counter1());console.log(counter1());console.log(counter2());What will be the output of the above program?
1
2
31
1
11
2
10
1
00
1
1