I have the following code:
let self = this;
for (const questionIndex in self.questions) {
self.givenAnswers[questionIndex] = "";
}
And PhpStorm is complaining about the line self.givenAnswers[questionIndex] = ""; saying that I need to check if the object has the property.
The full message is:
Possible iteration over unexpected (custom / inherited) members, probably missing hasOwnProperty check.
But the givenAnswers variable is an array and not an object, and I want to append new key and values. How do I remove the warning, or is there anything wrong with the code?