Everyone has JavaScript, right?
How your JS reaches the user
- Your user requests your web app
- Has the page loaded yet?
- Did the HTTP request for the JavaScript succeed?
- Did the HTTP request for the JavaScript complete?
- Does the corporate firewall block JavaScript?
- Does their isp or mobile operator interfere with downloaded JavaScript?
- Is the user a microbrowser, getting details to embed in another app?
- Have they switched off JavaScript?
- Do they have Chrome's data saver mode turned on?
- Do they have addons or plugins installed which inject script or alter the dom in ways you didn't anticipate?
- Does their adblocker block a script you’re accidentally dependent on?
- Is the CDN up?
- Does their browser support the JavaScript you’ve written?
- Is all the above true? Then yes, your JavaScript works. PROBABLY.
“All your users are non-JS while they're downloading your JS”
If they're on a train and their net connection goes away before your JavaScript loads, then there's no JavaScript.
How many times have you had a mobile browser hang forever loading a page and then load it instantly when you refresh?
Because loads of them still do.
Sky accidentally block jQuery, Comcast insert ads into your script, and if you've never experienced this before, drive to an airport and use their wifi.
Microbrowsers are everywhere, every time someone pastes your URL into a chat app or a social media tool and it shows a preview, and they aren't going to wait for your 2MB client app to boot up.
If they do, and they're on a 2G or otherwise slow connection, Chrome will disable all scripting.
There are thousands of browser extensions. Are you sure none interfere with your JS?
Many people use adblockers, which may blanket-block whole domains. If you have one script dependent on another and that other script gets blocked, the remainder of your scripting may not start up.
CDNs are good at staying up (that’s what being a CDN is) but a minute downtime a month will still hit users who browse in that minute.
Check Can I Use for browser usage figures.
Progressive enhancement. Because sometimes your JavaScript just won’t work. Be prepared.