var obj = { foo: 'bar', baz: 42 }; Object.keys(obj).forEach((key) => { const el = obj[key]; console.log( { key: key, value: el } ); });