Java and Javascript are not the same
Being into the development for more than 13 years now — have heard people's reactions or confusion that Java and Javascript are the same things.
For Java to run it must be compiled and can run on JVM only but Javascript is more lightweight and can easily run on browsers.
Java can be used for creating applications from scratch whereas Javascript is mostly bundled with other frameworks like Angular, React, Vue, or HTML.
Though both overlaps each other in concepts like Object-Oriented Programming, Lambda Functions, etc. Syntax and usage make them different.
Last but not least — they both are from different creators :)