Since main.js has 'defer', the script executes after DOM is parsed. The DOMContentLoaded check was unnecessary - the else branch always executes. Simplified to just run immediately.
Since main.js has 'defer', the script executes after DOM is parsed. The DOMContentLoaded check was unnecessary - the else branch always executes. Simplified to just run immediately.