1var obj = { first: 'someVal' };
2obj[Object.keys(obj)[0]]; //returns 'someVal'
3
1var person = {"name":"Steve","age":43};
2var firstKeyValue = person[Object.keys(person)[0]]; //"Steve"
1var example = {
2 foo1: { /* stuff1 */},
3 foo2: { /* stuff2 */},
4 foo3: { /* stuff3 */}
5};
6
7let [first] = Object.keys(example)
8
9console.log(first)
1var person = { 'first_name': 'Johny', 'last_name':'Carson' };
2var firstName=person[Object.keys(person)[0]]; //get first value of object :'Johny'