13 lines
233 B
JavaScript
13 lines
233 B
JavaScript
function makeArmy() {
|
|
|
|
let shooters = [];
|
|
|
|
for(let i = 0; i < 10; i++) {
|
|
let shooter = function() { // shooter function
|
|
alert( i ); // should show its number
|
|
};
|
|
shooters.push(shooter);
|
|
}
|
|
|
|
return shooters;
|
|
}
|