const obj = {
a: 1,
b: 2,
c: 3,
};
// Long-hand
const keys = Object.keys(obj);
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
const value = obj[key];
// ...
}
// Short-hand
for (const key in obj) {
const value = obj[key];
// ...
}