Estaba viendo el código para agregarle la función each al objeto Array
Código:
Array.prototype.each = function(fun)
{
if(typeof fun != 'function') {
throw new TypeError();
}
for(var i=0; i < this.length; i++) {
if(i in this) {
fun.call(arguments[1], i, this[i]);
}
}
return this;
};
Pero no logro entender que comprueba este if
¿Alguien me puede ayudar?