Module Pattern and Revealing Module Pattern
Using closures (often via an IIFE) to create private state and expose only a deliberately chosen public API.
The module pattern is one of the oldest and most foundational design patterns in JavaScript, using closures to simulate the private/public member distinction that classes in other languages provide natively, long before ES6 modules or private class fields existed. It's still worth understanding deeply because the same closure-based privacy technique underlies countless real-world utilities and libraries.
The module pattern is like a magician's workshop with a single service window: all the actual tools, notes, and half-finished tricks (private variables/functions) stay locked inside the workshop, and the only things the public ever sees are the specific finished tricks (public methods) handed out through that one window, with zero way to reach past it into the workshop itself.