Memory and performance in JavaScript

How garbage collection decides what lives, the leak patterns that survive it, finding retainers with heap snapshots, and the performance model — Big-O in practice, hot paths, long tasks, and measuring before optimising.