Contact

What is JavaScript?

Definition

JavaScript is the programming language web browsers run natively, adding interactivity, dynamic content and application logic to pages. The language is standardised as ECMAScript (ECMA-262) by Ecma International's TC39 committee, which publishes a new edition every year. Runtimes such as Node.js also let developers use JavaScript for servers, command-line tools and build pipelines.

Also known as: JS, ECMAScript, ES6, vanilla JavaScript

Cycle diagram of the JavaScript event loop: call stack, Web APIs, task queue and the loop feeding callbacks back to the stack

Language, standard and runtime

"JavaScript" usually refers to three layers at once. The first is the language itself: variables, functions, objects, async/await, modules. These are defined in the ECMAScript standard; TC39 publishes a new edition every June, and the June 2026 release is the 17th edition. The 2015 edition, which brought the largest set of changes, is still commonly called "ES6".

The second layer is the APIs a host environment provides. The DOM, fetch, localStorage and timers are not part of the language; the browser supplies them. Node.js offers a different set, such as file system access and network servers. That split explains why window is undefined on the server. The third layer is the engine that makes the language fast: V8 in Chrome, SpiderMonkey in Firefox, JavaScriptCore in Safari.

How it runs in the browser

Page scripts execute on the main thread, the same thread that handles user input and paints the screen. While a script runs, the browser can do nothing else. Uninterrupted work longer than 50 milliseconds is a long task, and a click that lands during one is only processed when it ends. That wait shows up directly in INP.

<!-- Blocks HTML parsing -->
<script src="/legacy.js"></script>

<!-- Downloads in parallel, runs in order after parsing -->
<script src="/app.js" defer></script>

<!-- Module scripts are deferred by default -->
<script type="module" src="/main.js"></script>

A plain <script> tag pauses HTML parsing until it has downloaded and executed. defer and async remove that pause; the difference is that async scripts run as soon as they arrive, in no guaranteed order.

Byte for byte, the most expensive resource

An image and a script of the same size don't cost the browser the same. The image is decoded and painted; the script has to be downloaded, parsed, compiled and executed, much of it on the main thread. A bundle you never notice on a laptop can take seconds on a mid-range Android phone. That is why so much performance work comes down to shipping less JavaScript: dropping unused code, splitting bundles by route, questioning third-party scripts for analytics, chat and ads, and leaving non-interactive content as plain HTML.

Search engines and JavaScript

Google can execute JavaScript with an up-to-date Chromium, but it does so in a separate phase after crawling, and other bots may not render at all. Risk is lowest when the main content, headings, internal links and meta tags are already in the first HTML response. Links should also be real <a> elements with an href; elements that only navigate through a click handler are not reliably followed. The JavaScript SEO entry goes into the details.

Where it sits in the ecosystem

Libraries and frameworks such as React, Vue and Svelte are written in JavaScript and reach the browser as JavaScript. TypeScript is a superset that adds static types; the type information is erased at build time and what runs is still JavaScript. Whichever tool you pick, the size and execution cost of what the browser ends up running follow the same rules.

Related terms

← Back to the glossary