Is there an elegant way to access the first property of an object...
Here is a cleaner way of getting the first key:
var object = { foo1: 'value of the first property "foo1"', foo2: { /* stuff2 */}, foo3: { /* stuff3 */} }; let [firstKey] = Object.keys(object) console.log(firstKey) console.log(object[firstKey])