morr/jquery.appear — pull request #15 by hayesgm (2013-06-02 23:57:32+00:00)
Title: Uncaught TypeError: Object #<HTMLDocument> has no method 'filter' (Fixes issue #14)

When backporting Array compatibility to IE, functions my be added such as:

if (!Array.prototype.diff) {
Array.prototype.diff = function(a) {
return this.filter(function(i) {return !(a.indexOf(i) > -1);});
};
}

(see Compatibility in MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FArray%2FindexOf)

The for (index in some_array) will include non "hasOwnProperty" indices and thus break with this backport.

Using for (var i = 0; i < some_array.length; i++) syntax will fix this.