JavaScript

term

programmingweb dev

Kept in this browser · My desk

Brendan Eich's scripting language for web pages, designed and implemented at Netscape in May 1995, announced as JavaScript on 4 December 1995 and standardized as ECMAScript (ECMA-262) from June 1997.

Eich prototyped the first implementation, Mocha, in ten days; it shipped as LiveScript in a Navigator 2.0 beta in September 1995 and as JavaScript 1.0 in March 1996; ECMAScript 2026 is the 17th edition, June 2026.

What it is. JavaScript is the dynamically typed, prototype-based language that every web browser runs, standardized by Ecma International as ECMAScript (ECMA-262). Values carry types, variables do not; objects are collections of properties that inherit from other objects through a prototype link rather than from classes; functions are first-class values; and an event loop runs callbacks as events arrive.

Origin. Allen Wirfs-Brock and Brendan Eich's history, JavaScript: The First 20 Years, tells it from the records. Eich was recruited to Netscape in early 1995 with the promise of putting Scheme in the browser, but Netscape's senior managers, Marc Andreessen among them, and Sun's Bill Joy wanted a "little language" to complement Java, and the language had to "look like Java". Eich prototyped Mocha in ten days in May 1995 (he believes 6 to 15 May) on a Silicon Graphics Indy workstation, with a parser that emitted bytecode. The prototype had a hand-written lexer and a recursive-descent parser. Everyone agreed Mocha would be object-based but without classes, since supporting classes would take too long and risk competing with Java; out of admiration for Self, Eich chose a dynamic object model with delegation through a single prototype link, and functions came first-class as in Scheme. Mocha shipped as LiveScript in a Navigator 2.0 beta in September 1995, was announced as JavaScript with Sun on 4 December 1995, and reached version 1.0 in March 1996. Microsoft reverse-engineered it as JScript, work that began in October 1995.

Standards and status. Netscape contributed its specification to Ecma, whose General Assembly created Technical Committee 39 (TC39) in December 1996, when Microsoft also joined. Guy Steele, lent by Sun, edited the first edition of ECMA-262, approved by the General Assembly in June 1997, the date Ecma gives it (Wirfs-Brock and Eich date its publication to September 1997). The fourth edition was abandoned and never completed; the fifth followed in December 2009 and the sixth, ECMAScript 2015, in June 2015, after which editions became yearly. ECMAScript 2026, the 17th edition, was published in June 2026. TC39 evolves the language through six stages, a strawperson stage 0 and five maturity stages (1, 2, 2.7, 3 and 4); a proposal reaches stage 4 only with two compatible implementations that pass the Test262 acceptance tests, and TC39 submits each year's specification to the Ecma General Assembly for approval in July.

How it runs. Engines compile JavaScript as they run it. V8, the engine of Chrome, first compiles all code to bytecode for its Ignition interpreter, then hands hot functions to faster tiers: Sparkplug (2021), a baseline just-in-time (JIT) compiler; Maglev, a fast optimizing compiler introduced in Chrome 117 (described on 5 December 2023); and TurboFan, the peak-performance optimizer. The optimizing tiers speculate on the types they have seen and deoptimize when a guess fails. Outside the browser, Node.js presents itself as an asynchronous event-driven JavaScript runtime, entering the event loop after the input script and exiting when no callbacks remain.

Coercion. Its coercions ("5" + 2 is "52", "5" * "2" is 10) are written into the standard: the plus operator joins strings when one operand is a string, while multiplication converts both operands to numbers. The rules are deterministic, but they surprise anyone who expects an error, and input that arrives as text keeps its text type until code converts it.

What goes wrong. Engine speculation is a security boundary: a wrong type assumption becomes memory corruption in the engine. CVE-2023-2033 (Common Vulnerabilities and Exposures), a type confusion in V8 fixed in Chrome 112.0.5615.121, let a crafted HyperText Markup Language (HTML) page corrupt the heap; it was added to the Known Exploited Vulnerabilities (KEV) catalogue of the Cybersecurity and Infrastructure Security Agency (CISA) on 17 April 2023, and that catalogue counted 20 V8 type-confusion entries on 23 November 2026. In application code the characteristic JavaScript flaw is prototype pollution, MITRE's Common Weakness Enumeration CWE-1321: input that sets __proto__, constructor or prototype adds or replaces properties on every object; lodash before 4.17.12 let its defaultsDeep function be tricked this way (CVE-2019-10744, scored 9.1), and freezing Object.prototype is one mitigation. And the language is the payload of cross-site scripting, CWE-79, first in MITRE's 2025 Top 25.

What defenders can do. Patch browsers and runtimes fast: CVE-2023-2033 was published on 14 April 2023 and was already in the KEV catalogue three days later. Keep libraries past their fixed versions (lodash 4.17.12 and later for the prototype pollution above). Where objects are built from user input, refuse the __proto__, constructor and prototype keys or freeze Object.prototype, as CWE-1321 suggests, and treat every place where text becomes script in a page as a cross-site scripting risk.

Neighbours. Java, whose name and syntax it borrowed; TypeScript, its typed superset; Brendan Eich; Ecma; just-in-time compilation and type systems; cross-site scripting; WebAssembly, which browsers run beside it.

Also known as: ecmascript, js, livescript, mocha, ecma-262

Sources

← Back to J Back to the glossary