I have the following code:
for (i in awards) {
if (awards[i] instanceof Array === false) {
console.log(awards[i]);
httpFactory.patch(awards[i], {"read": true}, false);
}
}
My IDE shows this error relating to the code above:
Possible iteration over unexpected (custom / inherited) members, probably missing hasOwnProperty check
Checks for any instances of unfiltered for-in loops in JavaScript. The use of this construct results in processing inherited or unexpected properties. You need to filter own properties with hasOwnProperty() method. The validation works in JavaScript, html or jsp files.
Could you explain in more detail what is meant by this statement?