JavaScript scope isn’t mysterious but small misunderstandings about where variables live and how they’re accessed can lead to bugs that are hard to spot and even harder to fix. Same variable name.