What Is JavaScript?
What JavaScript is and where it runs: its history, the ECMAScript standard and its yearly editions, the engines inside browsers, and Node.js on servers and in tools.
What JavaScript is
JavaScript is a general-purpose, high-level programming language. It started as the language of web pages and is still the only programming language that every web browser runs natively. When a page reacts to a click, checks a form before sending it, or loads new data without reloading, JavaScript is doing the work. As of October 2026, W3Techs counts JavaScript as the client-side language of 98.9% of all websites.
A few properties shape how the language feels:
- Dynamically typed. A variable has no fixed type; the value inside it does. See dynamic typing and Variables, Values and Types.
-
Weakly typed in places. Some operators convert
values on their own, so
"5" * 2is10. The page on type coercion explains when that happens and how to avoid surprises. - Multi-paradigm. You can write plain step-by-step code, use functions as values (functional style), or build objects and classes. See Programming Paradigms.
- Single-threaded with an event loop. Your code runs on one thread; waiting for a network reply or a timer does not block it. The general idea is in Programming Concepts; Asynchronous JavaScript shows it in practice.
Here is a complete JavaScript program. It works out the average of some meter readings and prints a line of text:
// Daily electricity use (kWh) of one household, from a smart meter
const readings = [11.2, 9.8, 12.5, 10.1, 13.4];
let total = 0;
for (const kwh of readings) {
total = total + kwh;
}
const average = total / readings.length;
console.log("Days measured:", readings.length);
console.log("Average per day:", average.toFixed(1), "kWh");
Days measured: 5 Average per day: 11.4 kWh
Blocks are marked with curly braces { }, statements
usually end with a semicolon, // starts a comment, and
console.log() prints a line. The next page,
Running JavaScript, shows where to type and run code like this.
A short history
Brendan Eich created the language at Netscape in May 1995, in about ten days, as a lightweight scripting language for the Netscape Navigator browser. It was first called Mocha, then LiveScript, and was renamed JavaScript in December 1995 — at a time when Java was the most talked-about language, so the name was largely marketing. It first shipped in Navigator 2.0.
Microsoft soon shipped its own version, JScript, in Internet Explorer 3 (1996). To keep the browsers compatible, work on a common standard started at Ecma International, a standards organization, in November 1996. The first edition of that standard was adopted in June 1997.
JavaScript is not Java
The names are similar, the languages are not. Java is a statically typed, compiled language with classes at its core; JavaScript is dynamically typed, was designed to be embedded in web pages, and builds objects on prototypes. Calling JavaScript "Java" in a job interview or a ticket is a classic beginner slip.
ECMAScript and TC39
ECMAScript is the name of the standardized language, published by Ecma International as the standard ECMA-262. JavaScript is the common name of the language that implements it. (The usual explanation for the two names is that "JavaScript" is a trademark, today held by Oracle.) In practice the names are used interchangeably, and editions go by short names: "ES6" and "ES2015" mean the same edition.
The standard says what the language itself does: the syntax, the
types, the operators, and built-in objects such as
Array, Math and JSON. It does
not describe web pages, files or networks; those come from
the environment the code runs in (see
runtime environments below).
Editions of the standard
| Edition | Year | What it brought (selection) |
|---|---|---|
| 1st – 3rd | 1997 – 1999 | The original language; the 3rd edition was the baseline for a decade |
| 4th | — | Abandoned, never published |
| 5th (ES5) | 2009 |
Strict mode, JSON, array methods such as
forEach and map
|
| 6th (ES2015, also "ES6") | 2015 |
let and const, arrow functions,
classes, modules, promises, destructuring, template
literals, Map and Set
|
| ES2016 – ES2025 | every June |
Smaller yearly additions, for example BigInt,
?? and ?. (ES2020), top-level
await and private fields (ES2022),
toSorted() (ES2023),
Object.groupBy() (ES2024), Set methods and
iterator helpers (ES2025)
|
| 17th (ES2026) | June 2026 |
Array.fromAsync(),
Error.isError(),
Math.sumPrecise(), Base64 and hex for
Uint8Array, Map
getOrInsert(), Iterator.concat()
|
ES2015 is the dividing line you will meet most often. Code and
tutorials written before it use var, function-based
"classes" and long chains of callbacks; code written after it uses
let/const, class, modules and
promises. The standard itself calls ES2015 the foundation for
"regular, incremental" improvements, and since ES2016 a new edition
has been published every June. As of October 2026 the current
edition is ES2026, the 17th, approved by the Ecma
General Assembly on 30 June 2026.
TC39 and the proposal process
TC39 (Technical Committee 39) is the Ecma committee that develops ECMAScript. Its members include the browser makers, other companies and invited experts. Every new feature goes through a public process of stages:
| Stage | Meaning |
|---|---|
| 0 | An idea, not yet taken up by the committee |
| 1 | A problem worth solving; solutions are being explored |
| 2 | A preferred design, being refined |
| 2.7 | Specification text complete; now tested and validated |
| 3 | Ready for implementation experience in engines |
| 4 | Finished: shipped in two compatible implementations, included in the next yearly edition |
Older material lists only stages 0 to 4; stage 2.7 was added later. When a blog post calls a feature "stage 3", it means the design is settled but you cannot yet count on it everywhere.
JavaScript engines
A JavaScript engine is the program that reads JavaScript source code and executes it. Each major browser family has its own:
| Engine | Made by | Used in |
|---|---|---|
| V8 | Chrome, Edge and other Chromium browsers; Node.js; Deno | |
| SpiderMonkey | Mozilla | Firefox |
| JavaScriptCore | Apple | Safari |
Interpreted or compiled?
Traditionally JavaScript is called an interpreted language: you hand the source code to the engine and it runs it, with no separate build step that produces a program file. That is still the right short answer. (The difference between a compiler and an interpreter is explained on the Python page.)
Modern engines are cleverer than a plain interpreter. They parse the source into a syntax tree, turn it into bytecode and start running that at once. While the program runs, the engine watches which functions are called often ("hot" code) and compiles those to machine code for the processor. This is just-in-time (JIT) compilation, and it is why JavaScript today is far faster than in the 1990s. The engine also has a garbage collector, which frees memory you no longer use (see garbage collection).
Runtime environments
An engine on its own can calculate, but it cannot show anything on a screen, read a file or wait for a network reply. Those abilities come from the runtime environment: the program that embeds the engine and adds host APIs (extra objects and functions) plus an event loop that schedules work.
This split explains a lot of confusion. document
(the web page) exists in a browser but not in Node.js;
process (the running program) exists in Node.js but not
in a browser. Both are host APIs, not part of ECMAScript. The
built-in globalThis works everywhere and points to the
environment's global object. Run this in Node.js:
// Which host APIs does this environment offer?
console.log("document:", typeof document);
console.log("process:", typeof process);
console.log("globalThis:", typeof globalThis);
console.log("Math (part of the language):", typeof Math);
document: undefined process: object globalThis: object Math (part of the language): object
In a browser console the first two lines would be the other way
around: document is an object and
process is undefined.
typeof is explained in
Variables, Values and Types.
Client-side and server-side
Client-side JavaScript runs in the user's browser, on their device. It is downloaded with the page, so anyone can read it in the browser's developer tools — never put passwords or API keys in it, and never trust it to enforce rules: a user can change or skip it. The page and its objects are described in The DOM and Events; how the browser keeps sites apart is in Browsers and the Same-Origin Policy.
Server-side JavaScript runs on a machine you control, usually in Node.js. It handles requests, talks to databases and holds the secrets. This is where checks that matter, such as "may this user see this invoice?", belong. See How the Web Works for the trip between the two.
Node.js
Node.js is a runtime environment that
runs JavaScript outside the browser. It takes the V8 engine and adds
host APIs for files, network connections, processes and timers, plus
the npm package manager. With it, JavaScript is used
for web servers and APIs, command-line tools, build tools and
automation scripts. Many tools that web developers use every day —
linters, test runners, bundlers — are themselves Node.js programs.
Node.js versions
Node.js has two kinds of release lines. A Current line gets the newest features; a Long-Term Support (LTS) line gets security and bug fixes for 30 months and is the one to use for real work. As of October 2026:
| Line | Status on 1 October 2026 | End of life |
|---|---|---|
| Node.js 26 | Current; becomes LTS on 28 October 2026 | 30 April 2029 |
| Node.js 24 | Active LTS (the recommended version) | 30 April 2028 |
| Node.js 22 | Maintenance LTS (fixes only) | 30 April 2027 |
| Node.js 20 | End of life since 30 April 2026 | — |
Install the current LTS line from
nodejs.org or your operating
system's package manager, and check it with
node --version. A version that has reached end of life
no longer gets security fixes, so plan upgrades. The rule of thumb
"even-numbered versions become LTS, odd ones do not" is ending: from
Node.js 27 (April 2027) there is one major release a year, and every
one becomes LTS.
Deno and Bun
Two newer runtimes compete with Node.js.
Deno is built on V8 and Rust; since version 2.0
(October 2024) it is largely backward compatible with Node.js and
npm, including package.json and
node_modules. Bun is an all-in-one
toolkit with its own runtime and package manager. Both aim to run
most Node.js code. For learning, Node.js is the safe choice: it has
the most documentation and is what most jobs expect.
Where JavaScript is used
- Web front ends — everything interactive on a web page, from a menu that opens to a full application in the browser built with a framework such as React, Vue or Angular.
- Web back ends and APIs — servers in Node.js, often with a framework such as Express (see REST APIs).
- Tooling and automation — build tools, linters, formatters, and scripts in CI/CD pipelines.
- Desktop and mobile apps — with Electron (for example Visual Studio Code) or React Native.
- Configuration and data — JSON, the most common data format of web APIs, is borrowed from JavaScript's object notation (see JSON and Other Data Formats).
Popularity figures depend on what is measured. In the Stack Overflow Developer Survey 2025, JavaScript was the most used language (66% of respondents). On GitHub, counted by monthly contributors, TypeScript — JavaScript with type annotations, compiled to plain JavaScript — overtook both Python and JavaScript in August 2025. TypeScript is introduced in Code Quality: Style, Linting, Testing and TypeScript; everything on these pages applies to it too.
Two short programs show that the language is the same everywhere. This one formats an outage ticket and would print the same lines in a browser console:
const ticket = { id: "INC-20417", region: "North", customers: 1250 };
console.log("Ticket", ticket.id, "in region", ticket.region);
console.log("Customers affected:", ticket.customers);
console.log(ticket);
Ticket INC-20417 in region North
Customers affected: 1250
{ id: 'INC-20417', region: 'North', customers: 1250 }
The last line shows an object, a group of named values, printed in Node.js's own format. A browser console shows the same object as an expandable tree instead.