They're both mammals? They're both meat? Now you've got me curious. What would, say, the Komodo Dragon of Programming languages be? Some variant of Python, perhaps?
What would that make something like
Whitespace? An Eldritch Abomination?
Komodo Dragon of Programming languages... Hmm. Fearsome, has strong bite and can crush bones of the larger size. Based on your initial thought that it might be some variant of Python, and Python is used in scientific/Tensorflow context. What I'm going to suggest isn't Python but it is still the strongest, most fearsome programming language that I've used: Fortran77 - the number cruncher. Ancient, fearsome, strong and has survived longer than many of its original users.
Whitespace is: "The Force that gives the Developer his power. It's an energy field created by all living things. It surrounds us and penetrates us. It binds the crunch-time-hack together."
But comparing Java and JavaScript. JavaScript is a
scripting language originally designed for Netscape navigator (That all present day browsers are - in certain sense), they picked the name JavaScript because Java was a new and fancy thing back then (~1995) and Netscape wanted to confuse people so that their own new language would get noticed. After that many things happened (IE was the market dominator, stagnant. Then came Firefox, a new era began and the Browser wars followed in the early 2000) and in the 2008 Google threw out Chrome with V8 JavaScript engine that used a trick called "just-in-time compilation" and was faster than the other browsers. If you've noticed, I talk about browsers. JavaScript is versatile programming language that is (originally) run inside user's browser. There exists variant(s) that runs on server side and that is called Node.js (I abhor this abomination).
Java is not run on browser (unless you have plug-in for it), it is primarily used on server back-end (and it has many many other uses too). Main strength of Java was/is its portability. Any machine that can run Java Runtime can run your Java-program (and that machine is powerful enough for that program - same as with any program really) without you having to take into account the operating system of the user or other system specifics. Also. Java is statically typed programming language (note: no scripting) and it usually means you have to have a lot of boilerplate (read: a lot of code to make simple program to run) but these are also its strengths. If you have ever wondered what C#-programming language is - it is Microsoft's attempt at copying Java. Same as JScript is Microsoft's attempt at copying JavaScript in "ye olden times".
Why JavaScript is so wide spread? Because it easy to get into. If you have a browser, you can easily (compile and) test your code. It means that JavaScript is easily "babbys first prughramming language" and it shows. JavaScript's users don't usually have any sort of formal training in programming so the likelihood of finding eldritch madness when browsing random repositories made with JavaScript is high. It also doesn't help that there are no common standard libraries (good code compilations for doing basic and more complicated but common tricks) for JavaScript so there are multiple and they don't necessarily talk with each other. This leads to needing huge trees of dependencies for basic functionality and that is insane. Basic program could have dependency for over thousand libraries. If even a single one of them was malicious or has an error causing a vulnerability then your program could/would be vulnerable too. It is an insane and daunting task to comb through them all just in case there is a problem. I abhor using JavaScript on anything that is even remotely important.
Even if I have strong feelings against JavaScript in general, it has its place and that is on browser and on the web. It is an excellent tool with browser games (just like TiTS and RPG Maker MV games). I prefer to use a programming languages for the task it is most suitable for. I don't use Node.js on server back-end as JavaScript-libraries tend to get born, evolve and die within months. Keeping a back-end secure and up-to date is a job in itself.
Sorry. Got bit carried away.
I'm happy that they are migrating to JavaScript with TiTS (playing from browser means it is OS independent). Java would be fine too as that is also portable and I could play on any machine that runs Java. Can't really tell which one would be more work. Both have their strengths.