How to get the length of a map in TypeScript

1 Answer

0 votes
const mp = new Map([
  ['javascript', 1],
  ['nodejs', 2],
  ['typescript', 3],
  ['php', 4],
]);

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

 



answered Jun 23, 2022 by avibootz

Related questions

1 answer 143 views
143 views asked May 1, 2023 by avibootz
1 answer 183 views
1 answer 146 views
1 answer 145 views
1 answer 179 views
1 answer 124 views
...