0

I know this has been asked before, but I don't quite understand why am I still getting this error after I already have the solution in every post an every answer.

I have the following code:

        for (key in datosMostrados) {
            if (datosMostrados.hasOwnProperty(key)) {
                // my logic goes here
            }
        }

I still get the error The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype guard-for-in

I have this same logic in other parts of the code but this is the only place where I still have this error after wrapping the for content inside the if with the hasOwnProperty method

Alejo Dev
  • 2,290
  • 4
  • 29
  • 45

0 Answers0