How to get a value of a map by key in TypeScript

1 Answer

0 votes
const mp = new Map([
  ['JavaScript', 3],
  ['TypeScript', 6],
  ['PHP', 9],
  ['Node.js', 4],
]);
  
console.log(mp.get('TypeScript'));
console.log(mp.get('PHP'));  
       
       
       
/*
run:
       
6
9
       
*/

 



answered May 28, 2022 by avibootz

Related questions

1 answer 201 views
1 answer 174 views
1 answer 154 views
1 answer 170 views
1 answer 167 views
1 answer 142 views
...