Last update: 26/09/19
Not to be confused with Java.
Problems that effect browsing
Account theft
Cross site scripting (XSS) can be used to steal accounts without needing passwords, 2FA, or programming knowledge.
This used to be a huge problem on Neopets: If someone clicked on a pet page or shop that had a cookie grabbing script, the page's owner would be able to access their account and steal it. This issue was so widespread that Neopets bans JavaScript entirely on custom pages now.
Privacy
JavaScript can be used to identify people, even when they use a VPN. It can access a lot of information about one's PC, such as installed fonts and window size. If someone had a unique set of fonts installed, it wouldn't matter what browser or IP they had. A site's owner would know who they are.
The following links demonstrate how easy it is to identify a computer with JavaScript enabled:
Security
JavaScript has been responsible for many browser exploits over the years. This is a major reason why people disable it.
Accessibility
If not taken into consideration, JavaScript can cause accessibility problems. It can make sites less accessible to screen readers, be overwhelming sensory-wise, and trigger photosensitive epilepsy in certain situations.
Cryptocurrency mining
It can be used to mine cryptocurrencies in the background. This uses up extra electricity, and strains computers, making them break faster. JavaScript in general puts extra strain on PCs to run, but crypto mining is one of the worst cases of it.
Data usage and speed
A lot of web developers use collections of code as a base (frameworks.) These frameworks can be pretty big, which quickly adds up to gigabytes spread over multiple sites. This slows sites down, and has prevented Californians from claiming SNAP benefits.
It's overused
CSS and HTML can do a lot of their own.
Non-browser related issues
The creator
Brendan Eich donated towards Prop 8 and its supporters, a vote against gay marriage in the United States. He co-founded Mozilla and was appointed as the CEO, but stepped down after backlash. These days he works as the cofounder and CEO of the Brave Browser (which also has issues and should be avoided) and posts COVID denial theories on Twitter.
Security, again
JavaScript isn't only used in browsers where it's (usually) sandboxed. It can do a lot more harm outside of a browser, see above. A common example is PDF files. The format can contain JavaScript, so be careful when opening PDF files.
It's aesthetically unpleasing and has weird design choices
This reason is more common than the others in web dev spaces. I agree, but please don't let some nerd opinions discount anything else I listed.
Notes
JavaScript isn't the only web technology with privacy and security flaws.