text/javascripttext/javascript is the media type for JavaScript source executed by browsers. Once slated for deprecation, it was revived by the current WHATWG HTML standard as the recommended type for serving scripts, and is today the de facto type for JS loaded via <script>.
RFC 4329 once treated application/javascript as canonical and marked text/javascript 'obsolete,' but because the real web overwhelmingly used text/javascript, WHATWG re-designated it as the official recommended type for interoperability. Browsers execute text/javascript and application/javascript identically, and `charset=utf-8` decodes non-ASCII strings and identifiers in the source correctly.
It matters that your static server or CDN maps .js to text/javascript. In particular, ES modules (<script type="module">, .mjs) require an exact JavaScript MIME type, and a wrong type makes the browser refuse execution under enforced nosniff.
e.g. Content-Type: text/javascript; charset=utf-8