The order of things in module augmentation
When we added Modules_2.js
file to our index.html
, I mentioned that we need to load this file after we load Modules.js
file for things to work properly.
The reason for this is not hard to discover. If the order of loading these files is reversed, and subsequently the order of the code execution, we will be trying to add properties to an object (ImagesInc_GlobalData
) that does not exist yet, which will result in a code execution error.
There are ways that we can work around this, which brings us to our next topic, loose augmentation.