Is there an elegant way to access the first property of an object...
You can use Object.prototype.keys
which returns all the keys of an object in the same order. So if you want the first object just get that array and use the first element as desired key.
const o = { "key1": "value1", "key2": "value2"};
const idx = 0; // add the index for which you want value
var key = Object.keys(o)[idx];
value = o[key]
console.log(key,value); // key2 value2