JavaScript is a dynamically typed programming language originally developed by Brendan Eich at Netscape in 1995. It was created for scripting within web browsers and was initially known by names including Mocha and LiveScript before becoming JavaScript. Despite its name, JavaScript is not a version of Java and the two languages have separate histories, specifications and runtime systems.
JavaScript became standardised through the ECMAScript specification, maintained through the Ecma International standardisation process, while web browsers provide additional APIs such as the DOM, Fetch, Web Storage and browser event systems that are not themselves part of the ECMAScript language. JavaScript has evolved from a browser scripting language into a general-purpose language used in frontend applications, servers, command-line tools, build systems, desktop applications and other environments. Modern JavaScript supports object-based and prototype-based inheritance, first-class functions, closures, asynchronous programming, modules, classes, promises, iterators, generators and many other features.
JavaScript's type system includes primitive values such as undefined, null, boolean, number, bigint, string and symbol, together with objects. The number type generally represents numeric values using IEEE 754 binary floating-point semantics, meaning that many integers can be represented exactly but some decimal fractions cannot. BigInt provides arbitrary-size integer values for suitable operations. JavaScript performs implicit type conversions in several contexts, which can produce behaviour unfamiliar to programmers coming from strictly statically typed languages.
Equality has both coercing and non-coercing forms, and modern development generally requires understanding the distinction between them. Objects are mutable collections of properties, and functions are first-class objects that can be stored, passed as arguments and returned from other functions. The language's prototype system is fundamental even though class syntax provides a more familiar object-oriented surface.
JavaScript execution is governed by an execution model involving execution contexts, lexical environments, a call stack and a job queue, while hosts such as browsers and Node.js provide mechanisms for asynchronous operations. The event loop coordinates execution of JavaScript jobs with host-provided operations such as timers, network activity and user-interface events. Promises represent eventual completion or failure of asynchronous operations, while async and await provide syntax for writing promise-based code in a sequential-looking style.
JavaScript's ordinary execution model is single-threaded with respect to an individual execution context, but environments can provide concurrency through mechanisms such as Web Workers and worker threads. This distinction matters because asynchronous programming and parallel execution are not equivalent concepts. Non-blocking I/O can allow one JavaScript execution context to remain responsive while operations are handled by the host environment.
JavaScript became central to web development because browsers embed JavaScript engines capable of executing scripts in web pages. Engines such as V8, SpiderMonkey and JavaScriptCore parse and execute ECMAScript code and apply techniques including just-in-time compilation and runtime optimisation. Browser APIs extend the language with facilities for manipulating documents, responding to events, communicating over networks, accessing storage and interacting with hardware capabilities where permitted.
The Document Object Model represents web documents as structured objects that JavaScript can inspect and modify, although the DOM is a web platform API rather than an intrinsic part of ECMAScript. Modern frontend applications frequently use modules, component frameworks and build systems, but these tools remain separate from the core language specification.
Outside browsers, JavaScript became particularly significant through environments such as Node.js, which uses the V8 engine together with operating-system and library integrations to provide server-side execution. Node.js made JavaScript practical for network services, command-line utilities, build tooling and other non-browser applications. Package ecosystems built around npm and related tooling provide a large collection of reusable modules. JavaScript is also used through frameworks and runtimes for desktop and mobile development, although those platforms introduce additional abstractions beyond the language itself. Full-stack development can therefore use JavaScript on both client and server sides, reducing the need to use entirely different programming languages for different application layers.
JavaScript supports functional programming through first-class functions, higher-order functions, closures, array methods such as map, filter and reduce, and immutable-data techniques. It also supports object-oriented programming through prototypes and class syntax. Destructuring, spread syntax, default parameters, template literals, modules and optional chaining have reduced boilerplate in modern code. The module system supports explicit imports and exports, although web browsers and server environments historically used different module mechanisms before ECMAScript modules became broadly supported. JavaScript's flexibility allows several programming styles, but the same flexibility can lead to inconsistent conventions and subtle runtime behaviour. Strict mode, linters, formatters, static analysis and TypeScript are frequently used to increase predictability in larger JavaScript projects.
JavaScript differs from TypeScript because TypeScript is a separate language that adds a static type system and other compile-time features before generally emitting JavaScript. JavaScript differs from Java despite the naming similarity and C-like syntax. It also differs from Python in its browser-native role and event-driven ecosystem, and from C and C++ in its managed runtime and high-level object model.
JavaScript's advantages include universal browser availability, a large ecosystem, mature asynchronous facilities and the ability to target both client and server environments. Limitations include dynamic-type complexity, historical compatibility baggage, dependency-management challenges and the possibility of subtle coercion or asynchronous-state errors. Performance can be very strong for suitable workloads because modern engines optimise dynamically, but performance characteristics depend heavily on engine behaviour, workload structure and interaction with the host environment.
JavaScript is standardised as ECMAScript, and the web platform is a separate but closely associated standards ecosystem. This distinction prevents inaccurate claims that every browser API is part of the JavaScript language itself. The language continues to evolve through annual ECMAScript specifications, while browser and server environments evolve independently. Security restrictions such as the browser same-origin policy are host-platform mechanisms rather than JavaScript language rules, although JavaScript applications operate within them.
JavaScript's enduring significance derives from its position as the principal general-purpose scripting language built into web browsers, its ability to support increasingly sophisticated application architectures and the expansion of its runtime ecosystem beyond browsers. Understanding JavaScript accurately therefore requires considering both ECMAScript semantics and the host environment in which a particular program executes.