I am having an issue in Internet Explorer 11 vs. Google Chrome.
The following code works in Chrome but does not seem to work in IE 11 with the familiar problem that the scope of the func(i) will always be 4, whereas in chrome it assigns the "i" value properly.
for (let i = 0; i < 5; i++) {
var select = document.getElementById("Select" + i);
select.addEventListener("change", function() {
func(i);
} ;
}
function func(num) {
console.log(num);
}
What is a quick workaround/conversion tactic for this as I have a lot of code that depends on the let statement working properly and would like to minimize revisions. Thanks.