I have the following for loop in JS and it works in all browsers but I am getting an "Expected ; " error in IE11 for the for loop line. Do I have to change format to make it play nice?
for (var filter of filters) {
//do something
}
for...of is an ES6 feature and therefore unsupported in IE. You need to either translate this to an ordinary for loop, or transpile your code before running it in an old browser like IE.
for...in is fine in IE, apparently even back to IE6 developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/… But it's a poor way to loop through an array, a regular for loop is almost always better.
for inloop like in the title of your question or afor ofloop like in the code you posted? And is it IE11 or IE8?