JavaScript collections

JavaScript Map, Set, WeakMap, WeakSet, and iterables

Learn JavaScript Map, Set, WeakMap, WeakSet, iterables, Object.entries, Object.fromEntries, keys, values, entries, and destructuring for modern collection handling.

Map, Set, and iterable lessons

  1. Iterables and for..of

    Understand Symbol.iterator, iterable objects, array-like values, and how for..of consumes data.

    Outcome: Loop through arrays, strings, maps, sets, and custom iterable data consistently.

    • JavaScript iterables
    • for of loop
    • iterator protocol
    Study Iterables
  2. Map collections

    Use Map for ordered key-value data, object keys, lookup tables, caches, and entries-based conversion.

    Outcome: Choose Map when plain objects are not the right structure for keyed data.

    • JavaScript Map
    • Map object
    • map set get has
    Study Map and Set
  3. Set collections

    Use Set for unique values, duplicate removal, membership checks, and ordered value iteration.

    Outcome: Model uniqueness directly instead of repeatedly scanning arrays for duplicates.

    • JavaScript Set
    • Set object
    • unique values JavaScript
    Study Map and Set
  4. WeakMap and WeakSet

    Store object metadata without preventing garbage collection by using weak collection references.

    Outcome: Attach private metadata to objects while avoiding accidental memory retention.

    • WeakMap JavaScript
    • WeakSet JavaScript
    • object metadata
    Study WeakMap and WeakSet
  5. Object keys, values, and entries

    Convert object properties into iterable arrays and transform dictionaries with Object.keys, values, entries, and fromEntries.

    Outcome: Move data between objects, arrays, maps, and transformation pipelines.

    • Object.keys JavaScript
    • Object.entries
    • Object.fromEntries
    Study Object.keys, values, entries
  6. Destructuring assignment

    Extract array and object values with destructuring patterns, defaults, aliases, rest syntax, and nested bindings.

    Outcome: Read structured collection data clearly without repetitive property access.

    • JavaScript destructuring
    • array destructuring
    • object destructuring
    Study Destructuring assignment