# JavaScript

> The language that runs inside web browsers, and on servers through Node.js.

- **Appeared:** 1995
- **Creators:** Brendan Eich
- **Maintained by:** Ecma International (TC39)
- **Type:** web
- **Status:** alive
- **Born from:** In May 1995 Brendan Eich was building a scripting language for Netscape Navigator, a prototype first called Mocha that was embedded in Navigator 2.0. Netscape decided it needed two languages for two mostly separate audiences, and management required the browser one to look like Java. Eich built its core from Scheme-style first-class functions and Self-style prototypes.
- **Reacts to:** scheme, self, java
- **Trade-offs:** garbage collected; dynamic types; runs on a virtual machine; concurrency: async. Cost: Variables can hold any type at any time, so large codebases rely on tests and tooling to catch mistakes that a compiler would catch in other languages.
- **Slots:** browser ●●● strong (Used on the client side by 98.9 % of websites.); server ●●○ ok (Node.js runs it on servers; PayPal moved its consumer web apps to it in 2013.); mobile ●●○ ok (React Native builds native iOS and Android apps from JavaScript.); cli ●●○ ok (Node scripts run from the terminal.); systems ○○○ none (Engines like V8 are written in C++; JavaScript does not write kernels or drivers.)
- **Alternatives:** typescript, dart, python
- **Won where:** Browsers: JavaScript is the client-side language of 98.9 % of all websites [source](https://w3techs.com/technologies/details/cp-javascript/); Electron desktop apps, among them Visual Studio Code and Slack [source](https://www.electronjs.org/apps); PayPal moved its consumer web applications to Node.js, starting with the account overview page [source](https://www.infoq.com/news/2013/11/paypal-java-javascript); React Native, released by Meta in 2015, for native iOS and Android apps [source](https://reactnative.dev/)
- **Timeline:** 1995: Brendan Eich designs JavaScript at Netscape in May [source](https://hopl4.sigplan.org/details/hopl-4-papers/10/JavaScript-The-First-20-Years); 1997: ECMA-262, the first ECMAScript standard, is published in June [source](https://www.ecma-international.org/publications-and-standards/standards/ecma-262/); 2009: Ryan Dahl presents Node.js at JSConf EU [source](https://blogs.igalia.com/ltilve/tag/javascript); 2015: The sixth edition of ECMA-262 is published in June [source](https://www.ecma-international.org/publications-and-standards/standards/ecma-262/)
- **Links:** [website](https://tc39.es/), [docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
- **PLDB:** https://pldb.io/concepts/javascript.html
- **Sources:** https://brendaneich.com/2008/04/popularity/, https://hopl4.sigplan.org/details/hopl-4-papers/10/JavaScript-The-First-20-Years, https://www.ecma-international.org/publications-and-standards/standards/ecma-262/, https://blogs.igalia.com/ltilve/tag/javascript, https://w3techs.com/technologies/details/cp-javascript/, https://www.electronjs.org/apps, https://www.infoq.com/news/2013/11/paypal-java-javascript, https://reactnative.dev/
- **Verified:** no, draft of 2026-10-30
- **Canonical:** https://langwhy.dev/lang/javascript/

## Why it exists

In May 1995 Brendan Eich was building a scripting language for Netscape Navigator. Netscape decided it needed two languages for two mostly separate audiences, and management required the browser one to look like Java ([Eich, "Popularity", 2008](https://brendaneich.com/2008/04/popularity/)). Eich built the core from Scheme-style first-class functions and Self-style prototypes. His prototype, first called Mocha, was embedded in Netscape Navigator 2.0 ([Eich, 2008](https://brendaneich.com/2008/04/popularity/)). The design is dated to May 1995 at Netscape in the history Eich wrote with Allen Wirfs-Brock ([HOPL IV](https://hopl4.sigplan.org/details/hopl-4-papers/10/JavaScript-The-First-20-Years)).

## What it trades away

JavaScript runs wherever a browser runs, and that reach comes with a loose type system. A variable can hold any type at any time, so a large codebase depends on tests and tooling to catch mistakes that a compiler would catch elsewhere. Compatibility was a problem from the start: within a year of release, Netscape's implementation and Microsoft's reverse-engineered one disagreed ([HOPL IV](https://hopl4.sigplan.org/details/hopl-4-papers/10/JavaScript-The-First-20-Years)). Standardization at Ecma began in 1996, and the first edition came out in June 1997 ([Ecma International](https://www.ecma-international.org/publications-and-standards/standards/ecma-262/)). The standard is now revised every year, so an old engine and a new one can run the same page differently.

## Where it won

JavaScript won the browser first. W3Techs puts its share of websites that use it as the client-side language at 98.9 % ([W3Techs](https://w3techs.com/technologies/details/cp-javascript/)). It moved to servers through Node.js, and in November 2013 PayPal said its consumer web applications would be built on Node.js, starting with the account overview page ([InfoQ](https://www.infoq.com/news/2013/11/paypal-java-javascript)). Electron apps use it for desktop software, and the Electron showcase lists Visual Studio Code and Slack ([Electron](https://www.electronjs.org/apps)). React Native, which Meta released in 2015, builds native iOS and Android apps from JavaScript ([React Native](https://reactnative.dev/)).

---
Data: CC0, https://github.com/langwhy/langwhy/blob/main/data/languages/javascript.yaml
