The comment I was replying to made statements about both Java and JavaScript, so my questions were also about both (and whether they were different). I just added a line break to make this clearer.
Ah, apologies, it seemed like you were accidentally conflating the two. Thanks for clarifying!