I really hate Netscape & Sun for causing that confusion, and making Javascript look like Java on the surface, particularly as it obscured the prototypal model of JS and made anonymous functions clunky until the arrow functions of ES6. But it was good marketing.