Here is the example code I’m using. The purpose here is to remove undefined/null/empty strings from strs.
var strs = ["val1", "val2", "val3"];
var filteredValues = strs.filter(function(s) { return s; });
1) If the application is hosted on Windows server 2008 R2, IIS7
- For IE 9/10 version it throws ‘Object doesn’t support property or method ‘filter”
- It works fine for Firefox and chrome
2) If the application is hosted on Windows 8, IIS 8
- The code works for IE 9/10, Firefox and chrome
How come the hosting environment matters in order to make this code work?
I just figured it out, hope this helps others,
It was related to documentation mode where the client was using IE7 documentation mode on IE 10 browers. I had to add the following in web.config to make sure the client uses standard documentation mode.