JS Obtenez la première valeur d'objet
var obj = { first: 'someVal' };
obj[Object.keys(obj)[0]]; //returns 'someVal'
GutoTrosla
var obj = { first: 'someVal' };
obj[Object.keys(obj)[0]]; //returns 'someVal'
var person = {"name":"Steve","age":43};
var firstKeyValue = person[Object.keys(person)[0]]; //"Steve"
var person = { 'first_name': 'Johny', 'last_name':'Carson' };
var firstName=person[Object.keys(person)[0]]; //get first value of object :'Johny'
var example = {
foo1: { /* stuff1 */},
foo2: { /* stuff2 */},
foo3: { /* stuff3 */}
};
let [first] = Object.keys(example)
console.log(first)