JavaScript Introduction
JavaScript is the programming language of the web — and, increasingly, of everything else. It runs in every browser on the planet, powers servers through Node.js, drives mobile and desktop apps, and even controls robots and satellites. If you learn one programming language to open the most doors, JavaScript is a very strong choice.
This page gives you the big picture: what JavaScript is, where it came from, where it runs, and how this tutorial series will take you from your first console.log to advanced topics like the event loop, closures, and modern tooling.
What is JavaScript?
JavaScript is a high-level, dynamically typed, multi-paradigm programming language. Let's unpack what each of those words means:
High-level — you work with variables, objects, and functions instead of memory addresses and CPU registers. The engine handles memory management for you (via garbage collection).
Dynamically typed — variables don't have fixed types. A variable can hold a number now and a string later. Types are checked at runtime, not when you write the code.
Multi-paradigm — you can write imperative, object-oriented, or functional code. JavaScript doesn't force one style on you.
Interpreted / JIT-compiled — you don't compile JavaScript ahead of time. Modern engines like V8 compile it to machine code on the fly, which is why it's so fast today.
Single-threaded with an event loop — JavaScript runs one thing at a time but handles thousands of concurrent operations through asynchronous callbacks, promises, and
async/await.
Here's what JavaScript looks like:
// Variables and template literals
const name = 'Ada'
const year = new Date().getFullYear()
// Functions (arrow syntax)
const greet = (person) => `Hello, ${person}! Welcome to ${year}.`
// Arrays and higher-order functions
const numbers = [1, 2, 3, 4, 5]
const doubled = numbers.map((n) => n * 2)
console.log(greet(name))
console.log(doubled)Hello, Ada! Welcome to 2026. [ 2, 4, 6, 8, 10 ]
A brief history: from LiveScript to ECMAScript
JavaScript was created in 1995 by Brendan Eich at Netscape — famously in about 10 days. It was first called Mocha, then briefly LiveScript, and finally renamed JavaScript as a marketing move to ride the popularity of Java (more on that confusing name below).
In 1996 Netscape handed the language to Ecma International for standardization, and the official specification was named ECMAScript (ECMA-262). That's why you'll see version names like ES5, ES6/ES2015, and ES2024 — "ES" stands for ECMAScript.
Year | Version | What it brought |
|---|---|---|
1995 | Mocha / LiveScript | The language is created at Netscape in 10 days |
1997 | ES1 | First official ECMAScript standard |
1999 | ES3 | Regular expressions, try/catch — the baseline for a decade |
2009 | ES5 |
|
2015 | ES6 / ES2015 | The big one: |
2016+ | ES2016 – present | Yearly releases: |
Since 2015, the language has evolved through the TC39 process — a committee of browser vendors, companies, and community members. New features move through five stages (Stage 0 proposal → Stage 4 finished), and every June a new ECMAScript edition ships with everything that reached Stage 4. This steady, yearly cadence is why modern JavaScript feels so different from the JavaScript of 2010.
Where does JavaScript run?
JavaScript needs an engine to run — a program that reads your code and executes it. Engines are embedded in runtimes that add extra capabilities:
Runtime | Engine | Where / what for |
|---|---|---|
Browsers (Chrome, Edge) | V8 | Interactive web pages, web apps — the DOM, events, fetch |
Firefox | SpiderMonkey | Same as above; the original JavaScript engine lineage |
Safari | JavaScriptCore | Same as above, on Apple platforms |
Node.js | V8 | Servers, CLIs, build tools — file system, networking, no DOM |
Deno | V8 | Modern secure runtime with TypeScript built in |
Bun | JavaScriptCore | Very fast all-in-one runtime, bundler, and test runner |
In the browser, JavaScript can manipulate the page (the DOM), respond to clicks and keystrokes, fetch data from servers, and store data locally. On the server (Node, Deno, Bun), it can read files, talk to databases, and handle HTTP requests. Same language, different superpowers.
What can you build with JavaScript?
Websites and web apps — from a simple form validation script to full applications like Gmail, Figma, or Notion.
Servers and APIs — Node.js powers backends at Netflix, PayPal, and LinkedIn.
Mobile apps — React Native and Ionic let you ship iOS and Android apps from one JavaScript codebase.
Desktop apps — VS Code, Slack, and Discord are built with Electron (JavaScript + Chromium).
Games — 2D and 3D games in the browser with Canvas, WebGL, and libraries like Phaser and Three.js.
Tooling and automation — bundlers, linters, scrapers, bots, and scripts of every kind.
JavaScript is not Java
The most famous naming confusion in programming: JavaScript has almost nothing to do with Java. The name was chosen in 1995 purely for marketing, because Java was the hot new language at the time. As the saying goes: "Java is to JavaScript as car is to carpet."
JavaScript | Java | |
|---|---|---|
Typing | Dynamic, checked at runtime | Static, checked at compile time |
Compilation | JIT-compiled by the engine | Compiled to bytecode ahead of time |
Runs in browsers | Yes, natively everywhere | No (browser applets are long dead) |
OOP model | Prototype-based (with class syntax) | Class-based |
Threading | Single-threaded + event loop | Multi-threaded |
Typical use | Web, servers, tooling, mobile | Enterprise backends, Android |
Your first script
The fastest way to run JavaScript is the browser console: open any page, press F12 (or Cmd+Option+J on Mac), and type into the Console tab. For real projects, JavaScript lives in .js files loaded by an HTML page with a script tag:
<!DOCTYPE html>
<html>
<head>
<title>My First Script</title>
</head>
<body>
<h1>Hello!</h1>
<!-- Inline script -->
<script>
console.log('Hello from inline JavaScript!')
</script>
<!-- External file (preferred) -->
<script src="app.js"></script>
</body>
</html>And in app.js:
const message = 'Hello, World!'
console.log(message)
// You can also write to the page itself
document.querySelector('h1').textContent = messageHello, World!
.js files rather than inline scripts. It keeps HTML clean, lets the browser cache your code, and works with modern tooling. Add thedefer attribute so the script loads without blocking the page.Prefer the terminal? If you have Node.js installed, running a file takes one command:
node app.js
The modern JavaScript era (ES6 and beyond)
In 2015, ES6 (ES2015) transformed the language. If you saw JavaScript years ago and found it clunky, it's worth a second look. Modern JavaScript gives you:
letandconst— block-scoped variables that replace the quirkyvarArrow functions — shorter syntax with predictable
thisbehaviorTemplate literals — string interpolation with backticks
Destructuring — unpack arrays and objects in one line
Classes — familiar OOP syntax over prototypes
Modules —
importandexportfor organizing code across filesPromises and
async/await— asynchronous code that reads like synchronous codeSpread/rest (
...), default parameters, optional chaining (?.), and much more
// Modern JavaScript in action
const users = [
{ name: 'Ada', role: 'admin' },
{ name: 'Grace', role: 'engineer' },
]
// Destructuring + arrow function + template literal
const describe = ({ name, role }) => `${name} is an ${role}`
// async/await for asynchronous work
async function loadUser(id) {
const response = await fetch(`/api/users/${id}`)
const user = await response.json()
return describe(user)
}
console.log(users.map(describe))[ 'Ada is an admin', 'Grace is an engineer' ]
How JavaScript compares to other languages
Language | Typing | Main home | Compared to JavaScript |
|---|---|---|---|
Python | Dynamic | Data science, scripting, backends | Similar ease of learning; JS owns the browser, Python owns data/ML |
Java | Static | Enterprise, Android | More ceremony and structure; unrelated despite the name |
TypeScript | Static (gradual) | Large JS codebases | A superset of JavaScript that adds types — covered later in this series |
PHP | Dynamic | Server-side web | Server-only; JS runs on both client and server |
C# | Static | Enterprise, games (Unity) | Compiled and class-based; JS is lighter-weight and web-native |
Your learning path in this series
This tutorial series is arranged so each section builds on the last. Here's the road ahead:
Fundamentals — syntax, variables, data types, operators, and control flow (
if, loops,switch).Functions and scope — declarations, arrow functions, closures, hoisting, and the
thiskeyword.Objects and arrays — the core data structures, plus destructuring, spread, and powerful array methods like
mapandreduce.The DOM and events — selecting elements, handling clicks, and building interactive pages.
Asynchronous JavaScript — callbacks, promises,
async/await, the event loop, and fetching data from APIs.Modern features and modules — ES6+ syntax,
import/export, and organizing real projects.Advanced topics — prototypes, classes, generators, memory management, and design patterns.
Tooling — npm, bundlers, linting, testing, transpilers, and a gentle introduction to TypeScript.
Ready? Head to the next page to set up your environment and write your first real program. Welcome to JavaScript — the language that runs the web.