JS Built-ins
← Map45 / 55
Mapvaluesintermediate

Map values() β€” mixed value types

πŸ“– Usage Example
const m = new Map([['a', 1], ['b', 2]])
for (const v of m.values()) {
  console.log(v) // 1, 2
}

Use Map.values() to iterate over all values in insertion order.

Map.prototype.values()

Map values can be any type β€” strings, numbers, objects, null, etc.

Challenge: Verify that values() works with mixed value types.

πŸ’‘ Hints (1)
  • β€’ Map values can be any JavaScript value, including null and undefined