Firstly, for...in
is used to enumerate over object properties, not to iterate through arrays used to enumerate over object properties, not to iterate through arrays. You should use a traditional for
loop for this.
Secondly, you could probably refine your console logging portion a bit. It may not have any impact to application performance, but it would make your console look prettier.
$('body').on('click', '#logReport', function() {
var i, j, k, l;
console.group("Live Links:");
for (i=0, j=liveLinks.length; i<j; i++) {
console.log(liveLinks[i]);
}
console.groupEnd();
console.group("Dead Links:");
for (k=0, l=deadLinks.length; k<l; k++) {
console.log(deadLinks[k]);
}
console.groupEnd();
});
As far as I know, this works for both Google Chrome and Mozilla Firefox (FireBug). See here for more information.
Firstly, for...in
is used to enumerate over object properties, not to iterate through arrays. You should use a traditional for
loop for this.
Secondly, you could probably refine your console logging portion a bit. It may not have any impact to application performance, but it would make your console look prettier.
$('body').on('click', '#logReport', function() {
var i, j, k, l;
console.group("Live Links:");
for (i=0, j=liveLinks.length; i<j; i++) {
console.log(liveLinks[i]);
}
console.groupEnd();
console.group("Dead Links:");
for (k=0, l=deadLinks.length; k<l; k++) {
console.log(deadLinks[k]);
}
console.groupEnd();
});
As far as I know, this works for both Google Chrome and Mozilla Firefox (FireBug). See here for more information.
Firstly, for...in
is used to enumerate over object properties, not to iterate through arrays. You should use a traditional for
loop for this.
Secondly, you could probably refine your console logging portion a bit. It may not have any impact to application performance, but it would make your console look prettier.
$('body').on('click', '#logReport', function() {
var i, j, k, l;
console.group("Live Links:");
for (i=0, j=liveLinks.length; i<j; i++) {
console.log(liveLinks[i]);
}
console.groupEnd();
console.group("Dead Links:");
for (k=0, l=deadLinks.length; k<l; k++) {
console.log(deadLinks[k]);
}
console.groupEnd();
});
As far as I know, this works for both Google Chrome and Mozilla Firefox (FireBug). See here for more information.
Firstly, for...in
is used to enumerate over object properties, not to iterate through arrays. You should use a traditional for
loop for this.
Secondly, you could probably refine your console logging portion a bit. It may not have any impact to application performance, but it would make your console look prettier.
$('body').on('click', '#logReport', function() {
var i, j, k, l;
console.group("Live Links:");
for (i=0, j=liveLinks.length; i<j; i++) {
console.log(liveLinks[i]);
}
console.groupEnd();
console.group("Dead Links:");
for (k=0, l=deadLinks.length; k<l; k++) {
console.log(deadLinks[k]);
}
console.groupEnd();
});
As far as I know, this works for both Google Chrome and Mozilla Firefox (FireBug). See here for more information.