This commit is contained in:
Ilya Kantor 2017-02-19 01:41:36 +03:00
parent d7d25f4d8b
commit 20784e7f26
48 changed files with 302 additions and 397 deletions

View file

@ -1,19 +1,13 @@
function makeArmy() {
var shooters = [];
for (var i = 0; i < 10; i++) {
var shooter = (function(x) {
return function() {
alert(x);
};
})(i);
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;
}
}