In my opinion, Java is a good starting point because you will learn better programming habits that will be useful further into a programming career.
JS itself isn’t a virus building language nor does it have access to the system. It’s isolated in the browser. However, JS can be used to redirect you to a malicious site or embed an iframe that displays the malicious site. But JS isn’t the language that carries out the attack, it just aids the attack.