Javascript modules have been around for a while, and there are plenty of good reasons why to use them, instead of writing code directly in the global scope.
However, you might find yourself working on a legacy piece of code that was written without taking modules into account and considering what to do to start refactoring it into a module based pattern, like AMD or CommonJS. Well, that was my case.