How to check if object is of type map in TypeScript

1 Answer

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

console.log(mp instanceof Map);
 
 
 
   
/*
run:
   
true
   
*/

 



answered Jun 23, 2022 by avibootz

Related questions

1 answer 127 views
2 answers 233 views
1 answer 134 views
1 answer 145 views
1 answer 120 views
1 answer 199 views
...