Here's a fun fact that surprises a lot of people: JavaScript and Java are basically unrelated. The name was a marketing decision back in the 90s, not a technical one, and it has been causing mild confusion ever since. JavaScript is its own language, and it happens to be the only one that runs natively inside every web browser on the planet.
What that actually means
Open any website, right click, and look at "view page source" β the visible page is HTML, the styling is CSS, and anything that actually does something, anything that responds to a click, validates a form, or updates content without reloading the page, that's JavaScript. If a webpage feels alive rather than static, JavaScript is almost certainly involved.
A tiny taste
document.querySelector("button").addEventListener("click", function () {
alert("You clicked me!");
});Don't worry about understanding every piece of that yet β a whole tutorial later in this series is dedicated to exactly this pattern. For now, just notice the shape: find something on the page, and tell it what to do when a particular thing happens.
It isn't just for browsers anymore
For a long time, JavaScript only ran inside a browser. That changed with Node.js, a runtime that lets JavaScript run directly on a server or your own computer, completely outside any browser. This is a big part of why JavaScript ended up everywhere β the same language you use to make a button interactive can also power the server that button talks to.
Why it can feel a little weird at first
JavaScript has some quirks that trip up newcomers, and honestly, some of them trip up experienced developers too. Comparing values with == instead of === can silently do type conversion in surprising ways. Variables declared with var behave differently than let or const, in ways that genuinely matter (the next tutorial covers this properly). None of this makes JavaScript a bad language, it just means a few of its rules are worth learning deliberately rather than guessing at.
Is it worth learning?
If you want to build anything that runs in a browser, there really isn't an alternative β JavaScript isn't one option among many there, it's the only one, at least directly. Combined with how widely it's used on the server side too, it's one of the most practically useful languages you can spend time on, regardless of what kind of software you eventually want to build.