No, it isn’t necessary to learn Java before diving into JavaScript. JavaScript is used for web development and Java is for desktop development building applications for desktop and mobile platforms.
Java could be learned later after learning JavaScript for Backend development if you are interested in learning both Front-end and Back-end development.
Do take a look at Intellipaat’s Java certification course which has 7 guided projects apart from 40hrs of online instructor-led training to gain hands-on experience.
Also, check out our YouTube video from our experts on the Difference Between Java and JavaScript to gain more insight and get started.