get first element of object array javascript 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 element of array
console.log(ary[0]);
var obj = { first: 'someVal' };
obj[Object.keys(obj)[0]]; //returns 'someVal'
console.log(ary[0]);