target first key in object javascript code example
Example 1: javascript object first key
var person = {"name":"Steve","age":43};
var firstKeyValue = person[Object.keys(person)[0]]; //"Steve"
Example 2: get first object key javascript
var example = {
foo1: { /* stuff1 */},
foo2: { /* stuff2 */},
foo3: { /* stuff3 */}
};
let [first] = Object.keys(example)
console.log(first)