How to find object length in Node.js

1 Answer

0 votes
const obj = {
  id: 123,
  name: "tom",
  salary: 12900,
  work: true,
  room: 'A',
  area: "North"
}
 
console.log(Object.keys(obj).length); 
  
 
   
     
     
/*
run:
     
6
 
*/

 



answered Feb 24, 2022 by avibootz

Related questions

1 answer 185 views
1 answer 194 views
1 answer 208 views
...