Typically, the solution to for..in‘s notorious caveat is something along the lines of:
for(var prop in obj) {
if(obj.hasOwnProperty(prop)) {
foo(); bar(); baz();
}
}
I feel like it would be cleaner to just do:
for(var prop in obj) {
if(!obj.hasOwnProperty(prop)) continue;
}
The question is… Are they not functionally identical?
They are functionally identical. Period.
As for the matter of style, Douglas and his JSLint say: don’t use
continue:See http://javascript.crockford.com/code.html and search for “continue”