How to get an object value by index in Node.js

1 Answer

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

    
      
      
      
/*
run:
      
383912
tim
      
*/

 



answered May 28, 2022 by avibootz

Related questions

1 answer 136 views
1 answer 126 views
1 answer 133 views
1 answer 127 views
1 answer 129 views
1 answer 140 views
...