JavaScript
JavaScript is a programming language created to run snippets of code in web pages. Its language rules are standardized as ECMAScript, and it also runs outside browsers in environments such as Node.js. A major design debate concerned how far to change the language to support larger programs while keeping existing web pages working (Wirfs-Brock & Eich, 2020; Ecma International, 2024; Node.js, n.d.d; Eich, 2007; Microsoft, 2007).
Origins and standardization
Brendan Eich designed and first implemented JavaScript at Netscape in May 1995. He spent ten days on the prototype to demonstrate that the idea could work. Netscape and Sun Microsystems unveiled JavaScript in December 1995. The production release followed with Netscape Navigator 2.0 in March 1996 (Wirfs-Brock & Eich, 2020; Reuters, 1995).
Ecma adopted the first ECMAScript standard in June 1997. Its Technical Committee 39 (TC39) takes changes from proposals to finished specifications. One requirement at the final stage is that two compatible implementations pass the acceptance tests. Finished proposals enter the draft, then a yearly edition. The annual schedule began with the 2016 edition (Ecma International, 2024; Ecma Technical Committee 39, n.d.).
The fourth edition debate
The proposed fourth edition (ES4) divided participants over the size and purpose of the revision. Eich argued that JavaScript needed better support for larger programs and stronger checks on how code uses values. Microsoft favored a narrower update and gave priority to keeping existing web content working (Eich, 2007; Microsoft, 2007).
In 2008 the committee agreed to finish a narrower revision first and pursue a more modest successor. The agreement set aside proposals such as namespaces, which group names to keep them distinct, and kept a revised plan for classes. ES4 went unpublished. Some of its work entered the sixth edition, published in 2015, whose additions included classes, modules and promises (Eich, 2008; Ecma International, 2024).
Objects, conversions and modules
Ordinary JavaScript objects can inherit properties from other objects. A property is a named part of an object, such as the title of a menu. When an object has no property of its own by that name, JavaScript looks in a linked object called its prototype. The lookup follows successive prototypes until it finds a match or runs out of objects to check (Ecma International, 2024; Haverbeke, 2024c).
Operators can convert values automatically, a rule known as coercion. For example, "5" - 1 produces the number 4 because subtraction converts the text to a number. In "5" + 1, the plus sign converts the number to text and joins the two strings, producing "51" (Haverbeke, 2024d; Ecma International, 2024).
A module gives a unit of code its own scope, the area where its names are visible. It uses export to make selected names available and import to use names supplied by other modules (Haverbeke, 2024b).
How asynchronous code runs
Asynchronous code can start an operation and handle its result later. A callback is a function that can run when such an operation finishes. An event loop schedules these functions so they run one at a time within that loop (Haverbeke, 2024a).
A promise represents a result that may still be pending. Code can register a function with then to handle the result when it becomes available. Inside an async function, await pauses that function until the promise succeeds or fails. If the promise fails, await raises an exception at that point (Haverbeke, 2024a).
In browsers, the event loop runs a selected task and then processes its microtasks, the work scheduled to run at that checkpoint. Promise handlers go into the microtask queue, so a handler queued by the current task can run before the next task (WHATWG, 2026m).
Browsers provide web workers, which run scripts independently of scripts that handle the interface. Node.js provides worker threads that can execute JavaScript in parallel (WHATWG, n.d.g; Node.js, n.d.d).
Faults in browsers and Node.js
Browser JavaScript can fail when it reads or changes the document object model (DOM), the browser’s representation of a page that code can access. In a study of 502 fixed bug reports from 19 repositories, 68% of the JavaScript faults examined involved the DOM (Ocariza et al., 2017).
In Node.js, a race can occur when a program’s result depends on the order in which event handlers run. A handler is a function that responds to an event, such as the completion of a request. A study of open-source Node.js programs found faults caused by unexpected handler order, including cases where another handler ran between steps meant to act as a unit (Davis et al., 2017; Endo & Møller, 2020).
Tests can execute the relevant lines of code and still miss a faulty order of events. An investigation of 15 asynchronous issues found that ordinary test coverage could count code as covered even when tests missed its faulty asynchronous behavior (Ganji et al., 2023).
npm dependencies
Even small packages in npm, a registry of reusable software packages, can depend on many other packages. A package’s dependencies include the ones it uses directly and the ones those packages require in turn. In a study of 501,001 npm packages, 16% met the study’s definition of a small, simple package. Of that group, 18.4% had more than 20 direct and indirect dependencies (Abdalkareem et al., 2020).
The code shipped to users can include only a fraction of a project’s installed packages. In 49 projects that shipped dependencies using webpack or Rollup, the production bundles included 497 of 53,421 installed dependencies, about 0.9% (Latendresse et al., 2022).
A dependency update can cause a package’s own tests to fail. Among 384 npm packages with usable tests, 45 (11.7%) had at least one test failure traced to a breaking change in a dependency (Venturini et al., 2023).
Use in surveys and on GitHub
Developer surveys and repository activity measure different populations. Among the 14,099 people who answered Stack Overflow’s 2026 language question, 62% reported extensive work in JavaScript over the past year. The question allowed multiple choices, and 43.8% reported TypeScript. On GitHub, TypeScript ranked first by monthly contributors in August 2025 (Stack Overflow, 2026; GitHub Staff, 2025).
Further reading
- Wirfs-Brock and Eich trace JavaScript from the Netscape prototype through its first two decades of standardization (Wirfs-Brock & Eich, 2020).
- Haverbeke explains callbacks, promises and asynchronous functions with examples (Haverbeke, 2024a).
- Latendresse and colleagues measure how many installed npm dependencies end up in production bundles (Latendresse et al., 2022).
First published .
Known gaps
What this article cannot tell you yet.
- The share of JavaScript faults caused by asynchronous ordering across projects remains unclear.
- How much installed npm code reaches production with other build tools and in server deployments remains unclear.
- The adoption figures cover one developer survey and one measure of GitHub activity. Worldwide use remains outside their scope.
References
- Solid source
- Rated highly trustworthy by the research, and every passage taken from it was found in it.
- Weak source
- Rated low, or a passage taken from it was not found in it.
- Medium trust
- Rated medium by the research.
- Not checked
- Rated high, but its passages could not all be checked against it.
Show all 23 references
- Abdalkareem, R., Oda, V., Mujahid, S., & Shihab, E. (2020). On the impact of using trivial packages: An empirical case study on npm and PyPI. Empirical Software Engineering. https://das.encs.concordia.ca/pdf/abdelkareem_emse2020.pdf Solid source Peer-reviewed, read in large part.
- Davis, J., Thekumparampil, A., & Lee, D. (2017). Node.fz: Fuzzing the server-side event-driven architecture. Proceedings of the Twelfth European Conference on Computer Systems. https://people.cs.vt.edu/~dongyoon/papers/EUROSYS-17-NodeFz.pdf Solid source Peer-reviewed, read in large part.
- Ecma International (2024). ECMAScript 2024 language specification. Ecma International. https://262.ecma-international.org/15.0/index.html Solid source Documentation, read in large part.
- Eich, B. (2007). Open letter to Chris Wilson. Brendan Eich. https://brendaneich.com/2007/10/open-letter-to-chris-wilson/ Medium trust Blog post, read in large part.
- Eich, B. (2008). ECMAScript Harmony. es-discuss. https://esdiscuss.org/topic/ecmascript-harmony Medium trust Read in large part.
- Endo, A. T., & Møller, A. (2020). NodeRacer: Event race detection for Node.js applications. IEEE International Conference on Software Testing, Verification and Validation. https://cs.au.dk/~amoeller/papers/noderacer/paper.pdf Medium trust Peer-reviewed, read in large part.
- Ganji, M., Alimadadi, S., & Tip, F. (2023). Code coverage criteria for asynchronous programs. Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering. https://www.franktip.org/pubs/fse2023.pdf Medium trust Peer-reviewed, read in large part.
- GitHub Staff (2025). Octoverse: A new developer joins GitHub every second as AI leads TypeScript to #1. The GitHub Blog. https://github.blog/news-insights/octoverse/octoverse-a-new-developer-joins-github-every-second-as-ai-leads-typescript-to-1/ Weak source Vendor page, read in large part.
- Haverbeke, M. (2024a). Asynchronous programming. Eloquent JavaScript (4th ed.). https://eloquentjavascript.net/11_async.html Medium trust Book, read in large part.
- Haverbeke, M. (2024c). The secret life of objects. Eloquent JavaScript (4th ed.). https://eloquentjavascript.net/06_object.html Medium trust Book, read in large part.
- Haverbeke, M. (2024d). Values, types, and operators. Eloquent JavaScript (4th ed.). https://eloquentjavascript.net/01_values.html Medium trust Book, read in large part.
- Haverbeke, M. (2024b). Modules. Eloquent JavaScript (4th ed.). https://eloquentjavascript.net/10_modules.html Medium trust Book, read in large part.
- Latendresse, J., Mujahid, S., Costa, D. E., & Shihab, E. (2022). Not all dependencies are equal: An empirical study on production dependencies in npm. 37th IEEE/ACM International Conference on Automated Software Engineering. https://arxiv.org/abs/2207.14711 Solid source Preprint, read in large part.
- Microsoft (2007). Position statement to TC39-TG1 regarding the evolution of ECMAScript. Ecma International. https://archives.ecma-international.org/2007/TG1/tc39-tg1-2007-042.pdf Medium trust Vendor page, read in large part.
- Node.js (n.d.d). Worker threads. Node.js. https://nodejs.org/api/worker_threads.html Solid source Documentation, read in large part.
- Ocariza, F. S., Bajaj, K., Pattabiraman, K., & Mesbah, A. (2017). A study of causes and consequences of client-side JavaScript bugs. IEEE Transactions on Software Engineering. https://people.ece.ubc.ca/frolino/docs/jsbugsstudy_journal.pdf Solid source Peer-reviewed, read in large part.
- Reuters (1995). Sun, Netscape launch JavaScript language. Los Angeles Times. https://www.latimes.com/archives/la-xpm-1995-12-05-fi-10560-story.html Medium trust News article, read in large part.
- Stack Overflow (2026). Programming, scripting, and markup languages. Stack Overflow Developer Survey. https://survey.stackoverflow.co/2026/technology/data/languages Medium trust Read in large part.
- Ecma Technical Committee 39 (n.d.). The TC39 process. Ecma International. https://tc39.es/process-document/ Solid source Documentation, read in large part.
- Venturini, D., Cogo, F. R., Polato, I., Gerosa, M. A., & Wiese, I. S. (2023). I depended on you and you broke me: An empirical study of manifesting breaking changes in client packages. ACM Transactions on Software Engineering and Methodology. https://arxiv.org/pdf/2301.04563 Solid source Peer-reviewed, read in large part.
- WHATWG (2026m). HTML standard. WHATWG. https://html.spec.whatwg.org/multipage/webappapis.html#event-loops Solid source Documentation, read in large part.
- WHATWG (n.d.g). HTML standard: Web workers. WHATWG. https://html.spec.whatwg.org/multipage/workers.html Solid source Documentation, read in large part.
- Wirfs-Brock, A., & Eich, B. (2020). JavaScript: The first 20 years. Proceedings of the ACM on Programming Languages, 4(HOPL), Article 77. https://www.wirfs-brock.com/allen/jshopl.pdf Medium trust Peer-reviewed, read in large part.