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 203 views
1 answer 175 views
1 answer 158 views
1 answer 171 views
1 answer 168 views
1 answer 143 views
...