What does this program print?

from Closures
Node 24 beginner 2 min

What does this program print?

JavaScript
const readers = [];
for (var index = 0; index < 3; index += 1) {
  readers.push(() => index);
}

console.log(readers.map((read) => read()).join(','));
Open in playground
Report an error