`Map` accepts any key type and keeps insertion order with a real `size`. `Set` stores unique values. `WeakMap` holds keys weakly so entries can be garbage collected.
const seen = new Set(addresses.map((a) => a.toLowerCase())); const cache = new Map(); cache.set(provider, data);
Use a Map when keys are dynamic or non-string; use an object for fixed, known shapes.