Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

select the first property in an object

let obj = {
first: 'first property value',
second: "hello"};
obj[Object.keys(obj)[0]]; //returns 'first property value'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #select #property #object
ADD COMMENT
Topic
Name
2+9 =