In my code snippet, I am dealing with a generic type variable called data and I am looking for a way to access the values of its properties.
The method hasOwnProperty isn't effective in this case due to the generic nature of the data.
const data: T = getData();
for (const key in dato) {
if (dato.prototype.hasOwnProperty.call(dato, key)) {
const element = dato[key];
}
}