Lesson 2 · Chapter: Welcome+10 XP for reading
What Makes JavaScript Special?
Every programming language runs somewhere. JavaScript's superpower is where: it's the only language every web browser speaks natively.
That means JavaScript code runs, right now, on essentially every phone, laptop, TV, and tablet on Earth — no installation, no setup. Open a page, and it's already running.
javascript
let devices = ["phones", "laptops", "TVs", "watches"];
for (let device of devices) {
console.log("JavaScript runs on " + device);
}
Output
Press Run to see the output.
Where you'll use this
Anything you build in JavaScript, you can share with a link. No downloads, no app store — your friend taps it and your program runs. No other language can promise that.
More JavaScript superpowers:
- Instant feedback. Change code, refresh, see it — the browser is the fastest playground in programming.
- It escaped the browser. With Node.js, JavaScript also runs servers; with Electron, it becomes desktop apps. Discord, Slack, and VS Code are largely JavaScript.
- The world's biggest library shelf. npm, JavaScript's package registry, has millions of ready-made building blocks.
Did you know?
JavaScript was created in just 10 days in 1995 by Brendan Eich. Despite the name, it's unrelated to Java — that was 90s marketing. The 10-day language now runs on more devices than any other in history.