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 121 views
1 answer 136 views
1 answer 164 views
1 answer 135 views
1 answer 140 views
...