Learn JavaScript

Lesson 3 of 9 ¡ Map, Set, WeakMap, Iterators, Generators and Regular Expressions

Module 16 ¡ Map, Set, WeakMap, Iterators, Generators and Regular Expressions

Full Programs: An LRU Cache, a Word Index, a Paged Feed, a Tokenizer, a Log Parser and a Memo

ProReading

The last lesson took every method apart. Working code puts them back together. Six programs follow, each a tool you will meet in real codebases. Each one is small enough to read in a minute, and each leans on one idea from this module.

Checking what this lesson needs for youâ€Ļ

What is inside Full Programs: An LRU Cache, a Word Index, a Paged Feed, a Tokenizer, a Log Parser and a Memo

  1. The shape of these programs
  2. An LRU cache on a Map
  3. A word index: a Map of Sets
  4. A paged feed through an async generator
  5. A tokenizer with a sticky regex
  6. A log parser with named groups
  7. A memo per object with a WeakMap