const nodes = { 'a1': 'Desmond', 'a2': 'Jack', 'a3': 'Mei Ru'}
for
for (key in nodes) { if (nodes.hasOwnProperty(key)) { console.log(nodes[key]) }}
NOTE: Why need hasOwnProperty check.
Object.keys with for ... of (reliable)
for (const key of Object.keys(nodes)) { console.log(nodes[key])}
Object.entries
for (const [key, value] of Object.entries(nodes)) { console.log(key, value);}
NOTE: Can I use Object.entries