How to check if object is of type map in JavaScript

1 Answer

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

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

 



answered Jun 23, 2022 by avibootz

Related questions

1 answer 149 views
1 answer 134 views
1 answer 134 views
2 answers 230 views
1 answer 135 views
2 answers 165 views
...