CHALLENGE
function makeCounters() {
const counters = [];
for (var i = 0; i < 3; i++) {
let j = i;
counters.push(() => `${i}-${j}`);
}
return counters;
}
const [a, b, c] = makeCounters();
console.log(a(), b(), c());
export {};What is the output?
Anonymous Quiz
36%
0-0 1-1 2-2
46%
3-0 3-1 3-2
14%
undefined-0 undefined-1 undefined-2
4%
3-0 3-1 3-3