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 {}; Post #3449
2.11K
CHALLENGE
- ❤ 4
- 👍 1
- 🔥 1