How to get the length of a map in Node.js

1 Answer

0 votes
const mp = new Map([
  ['javascript', 1],
  ['node.js', 2],
  ['typescript', 3],
  ['python', 4],
]);

console.log(mp.size);
 
 
 
   
/*
run:
   
4
   
*/

 



answered Jun 23, 2022 by avibootz

Related questions

1 answer 144 views
144 views asked May 1, 2023 by avibootz
1 answer 122 views
1 answer 131 views
1 answer 136 views
1 answer 158 views
1 answer 127 views
1 answer 118 views
...