Though Java was 'designed', it was not 'designed' to be an http/web server.
JS, particularly Node.js has really adapted itself to that well.
And one small but massive difference: JSON is how data is passed and it fits seamlessly into Javascript, and doing JSON in Java is an ugly, ugly thing.
As soon as you compare not JS/Java, but Java/Tomcat vs. JS/NodeJS - then you get a different comparison.
I quite like using Typescript on Node.js over Java - development speed is faster, and this is a really important thing.