On the top level, we have one file and two folders. app.js is the script that will eventually end up in our users’ browsers.

<scriptsrc="/js/app.js"defer></script>

99% of the time, I include scripts in the head of the document with a defer tag. This means the script is loads and parses while the rest of the document is still loading. The script only gets executed after the document is ready.

The util folder contains utility functions; these aren't tied to DOM elements but are everyday helper functions that we'll use to build components. We've already reviewed a few utilities in the previous posts: $, $$, and listen.

The utility functions are split across multiple files to keep them manageable, although in smaller projects, you can start with a single util.js file and extract where necessary.