问题
How can i get this function out of the i iteration loop, since jshint gives me an error.
for (i = 0; i < portfolios.length; i++) {
return function () {
for (h = 0; h < markers.length; h++) {
markers[h].infobox.close();
}
markers[i].infobox.open(map, this);
};
})(marker, i));
}
}
thanks!
来源:https://stackoverflow.com/questions/21742651/a-loop-within-a-function-that-is-also-in-a-loop-gives-an-error