If you just for in
a object without if statement hasOwnProperty
then you will get error from linter like:
for (const key in myobj) {
console.log(key);
}
WARNING in component.ts
for (... in ...) statements must be filtered with an if statement
So the solutions is use Object.keys
and of
instead.
for (const key of Object.keys(myobj)) {
console.log(key);
}
Hope this helper some one using a linter.