using underscore filter in IE 7 & 8

09 Nov 2011

Array.prototype.filter seems to be slightly off in IE7-8. It looks like they have added support for standard array functions. That is, it looks like there is a prototype for this in IE7-8 mode in IE9. The problem is that the filter prototype does not work exactly as expected in underscore.

If we look at the documentation for this method on msdn you find that this is probably a bug.

It is simple to patch the prototype implementation you find using F12 in IE. Otherwise you could use the prototype described in the stackoverflow post (i.e. Mozilla’s Array filter implementation):



Comments or errors? Fork this post and do a pull request on github