Looking through some of our app code I found the following:
for (prop in aBunchOfData.properties) {
if (!aBunchOfData.properties.hasOwnProperty(prop)) continue;
doABunchOfProcessing(aBunchOfData.properties[prop]);
}
As far as I understand, for ... in
will only loop through the "own" properties of an object. Can the hasOwnProperty
check here ever make a difference? If so, under what conditions?
Thanks!