Most confusing JavaScript behavior traces back to a small set of mechanisms: how scope and hoisting work, what a closure actually captures, how this gets bound, how the call stack unwinds, and how the event loop orders asynchronous code. This is a complete reference for all of them together, since they constantly interact in real code — work through it in order, or jump straight to the section you need from the sidebar.