Now that we've solved the primary problem of upload.js not working, it's time to start looking at how the code in this file can be a little better organized.
Fortunately, there are a few easy places to start – functions.
The upload.js file has a handful of functions that are already self-contained. They receive all required variables as parameters, and they produce output that does not modify any existing data structure. This makes the functions in question ideal for extraction into modules.
In this episode, then, you'll see the first steps to begin extracting functions from the upload.js file, creating new modules, importing them into upload.js and continuing to work with the actual upload process.