What is JavaScript?
About 5 minutes
This site offers a structured, topic-per-page curriculum that takes you from web fundamentals to AI-era engineering — so you always know what to learn next, and why it matters in the real world.
By learning JavaScript, you can build interactive web pages yourself. With Node.js, you can go even further — servers, CLI tools, and AI applications, all in a single language. As of 2026, many of the apps you use every day run on JavaScript.
What is JavaScript?
Section titled “What is JavaScript?”JavaScript is a programming language created in 1995 by Brendan Eich at Netscape.
It was originally designed to make web pages interactive inside a browser, but today it goes far beyond the web frontend — it’s used everywhere from servers and mobile apps to desktop applications and AI tools.
Why does it have “Java” in the name?
Section titled “Why does it have “Java” in the name?”JavaScript is not the same as Java (a different programming language). The name was borrowed from the then-popular Java for marketing reasons; the two languages have almost no technical relationship. In practice, developers usually shorten it to JS.
JavaScript in everyday apps
Section titled “JavaScript in everyday apps”Many of the apps and services you use daily run on JavaScript.
Web apps and services
Section titled “Web apps and services”| Service | How JavaScript is used |
|---|---|
| Google Search | Real-time search suggestions, results that update without a full page reload |
| YouTube | Video player controls, dynamic comment loading |
| Twitter / X | Infinite scroll timeline, like-button animations |
| Gmail | Sending and receiving mail, drag-and-drop organization |
| Notion | Block editor, real-time collaborative editing |
| GitHub | Syntax highlighting, pull request UI |
When you type in a search box and suggestions appear without reloading the page — that’s all JavaScript.
Desktop apps (Electron)
Section titled “Desktop apps (Electron)”Surprisingly, many desktop apps you use every day are built in JavaScript through a framework called Electron.
| App | Purpose |
|---|---|
| VS Code | The most popular code editor |
| Slack | Team communication tool |
| Discord | Chat for gaming and communities |
| Figma (desktop) | UI/UX design tool |
| 1Password | Password manager |
Even if you thought “JavaScript is just a browser language,” you’re already using JavaScript-powered apps every day.
Mobile apps (React Native)
Section titled “Mobile apps (React Native)”With React Native, you can use JavaScript to build mobile apps that work on both iOS and Android.
| App | Purpose |
|---|---|
| Social media (some screens) | |
| Photo and video sharing (some screens) | |
| Shopify | E-commerce platform app |
| Microsoft Teams | Business communication tool |
AI tools and CLI tools (Node.js)
Section titled “AI tools and CLI tools (Node.js)”Many AI tools run on Node.js, the server-side runtime for JavaScript.
| Tool | Purpose |
|---|---|
| Claude Code | AI pair-programming tool |
| GitHub Copilot CLI | AI assistant for the terminal |
| ESLint / Prettier | Code quality checking and auto-formatting |
| Vite / webpack | Web application build tools |
JavaScript basics
Section titled “JavaScript basics”You can try JavaScript right now in your browser’s developer tools. Open Chrome or Safari, press F12 (or Command + Option + I on macOS), go to the Console tab, and start typing.
Variables and arithmetic
Section titled “Variables and arithmetic”// Define a variable
let name = "JavaScript";
let year = 2026;
// Concatenate strings
console.log("Hello, " + name + "!");
// → Hello, JavaScript!
// Arithmetic
console.log(year + 1);
// → 2027Conditionals
Section titled “Conditionals”let hour = new Date().getHours(); // Get the current hour
if (hour < 12) {
console.log("Good morning");
} else if (hour < 18) {
console.log("Good afternoon");
} else {
console.log("Good evening");
}Manipulating page elements
Section titled “Manipulating page elements”One of JavaScript’s defining features is the ability to manipulate HTML elements from code.
<!-- HTML -->
<button id="myButton">Click me</button>
<p id="result"></p>// JavaScript
const button = document.getElementById("myButton");
const result = document.getElementById("result");
button.addEventListener("click", () => {
result.textContent = "Button clicked!";
result.style.color = "blue";
});When you click the button, text appears without reloading the page. This is JavaScript’s core ability — making pages change dynamically.
Asynchronous code (API calls)
Section titled “Asynchronous code (API calls)”Modern JavaScript frequently uses async processing to call external APIs (like Claude’s AI).
// Example: fetch data from an external API
async function getWeather(city) {
const response = await fetch(`https://api.example.com/weather?city=${city}`);
const data = await response.json();
console.log(`Weather in ${city}: ${data.weather}`);
}
getWeather("Tokyo");Using async / await, you can wait for a response to come back while continuing to run other code.
Where JavaScript runs
Section titled “Where JavaScript runs”JavaScript runtime environments
Browser (Chrome, Safari, Firefox…)
└── Page interactions
└── DOM manipulation, animations
└── Form validation
Node.js (terminal / server)
└── Web servers (Express, Next.js)
└── CLI tools (Claude Code, etc.)
└── Build tools (Vite, webpack)
└── AI app development
Electron (desktop)
└── VS Code, Slack, Discord
React Native (mobile)
└── iOS / Android appsThe same JavaScript knowledge applies across all of these environments.
JavaScript vs. Python
Section titled “JavaScript vs. Python”Both JavaScript and Python are popular beginner languages, but they excel in different areas.
| Aspect | JavaScript | Python |
|---|---|---|
| Primary runtime | Browser / Node.js | Server / terminal |
| Strengths | Web frontend, UI | AI/ML, data analysis, automation |
| AI SDK support | ◎ (via Node.js) | ◎ (first-class support) |
| Getting started | Try it instantly in the browser | Typically requires a file to run |
| Syntax style | {} for code blocks | Indentation for code blocks |
If you want to build for the web, start with JavaScript. If you’re focused on AI or data analysis, start with Python. Learning both opens up a much wider range of possibilities.
Summary
Section titled “Summary”- JavaScript is the only programming language that runs natively in web browsers
- Everyday apps like Gmail, YouTube, VS Code, and Slack are built with JavaScript
- Via Node.js, it’s also used for servers, CLI tools, and AI applications
- It’s one of the most beginner-friendly languages — try it right now in your browser console
- Combining JavaScript with Python enables full-stack development across web and AI
Q: What’s the difference between JavaScript and TypeScript?
A: TypeScript adds a “type” system on top of JavaScript. TypeScript code is ultimately compiled into JavaScript before it runs. TypeScript is the standard in large-scale projects, but I recommend starting with plain JavaScript when you’re learning.
Q: Can I build AI apps with JavaScript alone?
A: Yes. The official SDKs from Anthropic and OpenAI support JavaScript (Node.js), so you can build apps using Claude or GPT entirely in JavaScript. The AI library ecosystem isn’t as large as Python’s, but JavaScript’s tight integration with the web is a real advantage.
Q: Is jQuery still necessary?
A: Not for new projects. jQuery became popular around 2006 to smooth over browser inconsistencies, but modern browsers have rich standard APIs that handle everything jQuery used to do — no library required.
See the references for the external specifications and background sources used on this page.[1][2]
References
Section titled “References”- MDN Web Docs — JavaScript — Mozilla’s official documentation
- JavaScript.info — A comprehensive JavaScript tutorial