How to get an object value by index in JavaScript

1 Answer

0 votes
const obj = {
  id: 383912,
  name: "albus",
  language: "javascript"
};
  
console.log(Object.values(obj)[0]); 
console.log(Object.values(obj)[1]); 

    
      
      
      
/*
run:
      
383912
"albus"
      
*/

 



answered May 28, 2022 by avibootz

Related questions

1 answer 112 views
1 answer 130 views
1 answer 155 views
1 answer 129 views
1 answer 131 views
...