Javascript has weak dynamic typing, so it'ing a number, and you haven't written explicit code to convert it to a number, then you can end up with the wrong answer. ("1" + 2) / 3 = 4 in Javascript. (Try it yourself online).
If you want to discuss about javascript, you are right here :-)
But be sure, you read more about it...
The typing sense is a widely discussed thing and everything has its pros and cons.
Javascript has other advantages against java. It is not overloaded, you can write your code faster, test it faster and you have callbacks. To explain that all you have to go very deep into programming. Its not done with a simple testing like that. And if you know, how to program, you can fix this by making sure your variable is, what it is supposed to be.
"1" + 2 is a string concatenation, so you have to make sure, that it is no string... and you can do that also in javascript. The only difference is, that java is yelling at you already before. Thats useful for noobs.
And if you want to make it sure, you can use Typescript for programming as well, wich can be transpiled easily to javascript. If you're the one that likes to be yelled at
Many bigger projects do this already to have the best out of both worlds...