If I have an object in the file core.js and I want to extend it in extension.js, how can I make sure that the object in core.js is actually loaded before extending it?
What is a good (and light) pattern for managing this kind of dependencies?
If I have an object in the file core.js and I want to extend
Share
You can just make sure you load your .js files in the correct order in the header of your HTML file. They will be loaded in the order you put them.
Or you could do something like:
Which will throw that alert error if an object called MyFramework is not currently loaded