Stop Using Nested Loops: The Notebook Pattern in JavaScript

The notebook pattern is a fast, O(n) approach to solving lookup problems and pattern matching in JavaScript using Maps and Sets. Learn it once, and you'll never reach for a nested loop again.