JS Module Pattern Example

This page is sourcing two javascript files. Both of them try to declare a variable x, and they are setting it to different values, meaning that at different points in your javascript execution, x is set to different values. This becomes hard to work with very quickly.

If you skipped through the alerts and didn't read them, now is a good time to download the JS file attached to this HTML page and open it in a separate editor so that you can follow along through the alerts as they happen.