js first object in array code example
Example 1: js get first object value
var obj = { first: 'someVal' };
obj[Object.keys(obj)[0]]; //returns 'someVal'
Example 2: js get first item from array
var colors = ["red", "green", "blue"];
var red=colors.shift();
//colors is now ["green","blue"];