So there is this function
Array.prototype.containsCaseInsensitive = function(obj) {
var i = this.length;
while (i--) {
if (this[i].toUpperCase() === obj.toUpperCase()) {
return true;
}
}
return false;
}
then I create this array:
ary = [0,1,2,3];
for (item in ary){
console.log(ary[item])
}
The output is as follows:
0
1
2
3
function(obj) {
var i = this.length;
while (i--) {
if (this[i].toUpperCase() === obj.toUpperCase()) {
return true;
}
}
return false;
}
Why is the function in the iteration? Thanks!