let o = {
'keyX' : {
'key1' : 1,
'key2' : 1,
'key3' : 1,
'key4' : 1,
},
'keyZ' : {
'key1' : 1,
'key2' : 1,
'key3' : 1,
'key4' : 1,
}
}
console.log(Object.keys(o[Object.keys(o)[0]])) // (4) ["key1", "key2", "key3", "key4"]