Here you see two web apps, the first is "ModularSales" and the second is "SimpleSales":
The first uses Require.js for modularity, while the other does not.
These are two handy samples to play with to get to understand the basics of RequireJS.
Get them here:
And watch the YouTube screencast to understand the code and the reasons for using RequireJS:
A related blog entry: