in object how to access first element code example
Example 1: js get first object value
var obj = { first: 'someVal' };
obj[Object.keys(obj)[0]]; //returns 'someVal'
Example 2: javascript get first property of object
var person = { 'first_name': 'Johny', 'last_name':'Carson' };
var firstName=person[Object.keys(person)[0]]; //get first value of object :'Johny'