如何获得 i 的当前值?
var array = [1, 2, 3];
for (var i = 0; i < array.length; i++)
{
$(element).load("http://www.google.de", () => {
console.log(i);
}
}
Will return 2, 2, 2... How can i return 0, 1, 2 ?
如何获得 i 的当前值?
var array = [1, 2, 3];
for (var i = 0; i < array.length; i++)
{
$(element).load("http://www.google.de", () => {
console.log(i);
}
}
Will return 2, 2, 2... How can i return 0, 1, 2 ?