1Object.entries(obj).forEach(
2 ([key, value]) => console.log(key, value)
3);
1var obj = {a: 1, b: 2, c: 3};
2
3for (const prop in obj) {
4 console.log(`obj.${prop} = ${obj[prop]}`);
5}
6
7// Salida:
8// "obj.a = 1"
9// "obj.b = 2"
10// "obj.c = 3"