How to get an object value by index in TypeScript

1 Answer

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

    
      
      
      
/*
run:
      
849731 
"tom" 
      
*/
     

 



answered May 28, 2022 by avibootz

Related questions

1 answer 140 views
1 answer 162 views
1 answer 167 views
1 answer 141 views
...