function makeFns() {
const result = [];
for (var i = 0; i < 3; i++) {
let j = i;
result.push(() => i + j);
}
return result;
}
const fns = makeFns();
console.log(fns.map(f => f()).join(',')); Post #3455
2.12K
CHALLENGE
- ❤ 5
- 🔥 1