javascript get key name from json object code example
Example 1: get first object key javascript
var example = {
foo1: { /* stuff1 */},
foo2: { /* stuff2 */},
foo3: { /* stuff3 */}
};
let [first] = Object.keys(example)
console.log(first)
Example 2: js get json keys
myObject = {
"key": "value"
}
Object.keys(myObject); // get array of keys