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 237 views
237 views asked May 1, 2023 by avibootz
1 answer 203 views
1 answer 232 views
1 answer 235 views
1 answer 260 views
1 answer 210 views
1 answer 205 views
...