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 197 views
1 answer 171 views
1 answer 153 views
1 answer 166 views
1 answer 164 views
1 answer 140 views
...