JS Built-ins
Mapbeginner

Map Constructor β€” typeof

πŸ“– Usage Example
const m1 = new Map()
const m2 = new Map([['x', 1], ['y', 2]])
console.log(m2.size) // β†’ 2

Use the Map constructor to create a new map, optionally passing an array of entries.

Map Constructor

typeof a Map instance returns 'object'.

Challenge: Verify that typeof new Map() is 'object'.

πŸ’‘ Hints (1)
  • β€’ Map instances are objects