var obj = { foo: 'bar', baz: 42 }; console.log(Object.entries(obj)); // [ ['foo', 'bar'], ['baz', 42] ] for(const [i, val] of Object.entries(obj)) new_obj[i] = val;