const readers = []; for (var index = 0; index < 3; index += 1) { readers.push(() => index); } console.log(readers.map((read) => read()).join(','));