This is something that seems to have started with the latest Chrome update, and I'm trying to find information on it but have been unsuccessful. Consider the following code:
var lines = ['asdf','qwer',''];
for (var i in lines) console.log(i, lines[i]);
If I run that in the Firefox "Firebug" console, my output, as expected, is this:
0 asdf
1 qwer
2 (an empty string)
However, when I run it in the Chrome console, I get this:
0 asdf
1 qwer
2
remove function ( from, to )
{
var rest = this.slice((to || from) + 1 || this.length);
this.length = from < 0 ? this.length + from : from;
return this.push.apply(this, rest);
}
I've noticed that extra "remove" item coming up regularly. The problem is that it breaks several of the jQuery plugins I've downloaded for use, which have code like this:
for (var i in lines) {
line = lines[i].split("=");
...
Since the extra element is a function, rather than a string, it doesn't have the split()
function, and so my code stops dead in its tracks with an error. I don't want to have to go through all my code manually removing elements from arrays, so is there some kind of flag I can set or command I can run before execution to prevent the extra element from being added?