I have a problem, I don't understand why my "console.log" from the "startAnimation" function
Shows me well: 20 19 18 ...
While in the "animationAnimation" function it returns me i = 1 i = 2 ....
animationAnimation(i, self) {
setTimeout(function() {
console.log("i =" + i);
}, 2000 * i);
return self;
}
startAnimation(self) {
for (let i = 20; i > 0; i--) {
console.log(i);
self.animationAnimation(i, self);
}
}