ECMAScript
   HOME

TheInfoList



OR:

ECMAScript (; ES) is a standard for scripting languages, including
JavaScript JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior. Web browsers have ...
,
JScript JScript is Microsoft's legacy dialect of the ECMAScript standard that is used in Microsoft's Internet Explorer web browser and HTML Applications, and as a standalone Windows scripting language. JScript is implemented as an Active Scripting eng ...
, and
ActionScript ActionScript is an object-oriented programming language originally developed by Macromedia Inc. (later acquired by Adobe). It is influenced by HyperTalk, the scripting language for HyperCard. It is now an implementation of ECMAScript (mean ...
. It is best known as a JavaScript standard intended to ensure the
interoperability Interoperability is a characteristic of a product or system to work with other products or systems. While the term was initially defined for information technology or systems engineering services to allow for information exchange, a broader de ...
of
web page A web page (or webpage) is a World Wide Web, Web document that is accessed in a web browser. A website typically consists of many web pages hyperlink, linked together under a common domain name. The term "web page" is therefore a metaphor of pap ...
s across different
web browser A web browser, often shortened to browser, is an application for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's scr ...
s. It is standardized by
Ecma International Ecma International () is a Nonprofit organization, nonprofit standards organization for information and communication systems. It acquired its current name in 1994, when the European Computer Manufacturers Association (ECMA) changed its name to ...
in the documen
ECMA-262
ECMAScript is commonly used for
client-side scripting A dynamic web page is a web page constructed at runtime (during software execution), as opposed to a ''static web page'', delivered as it is stored. A server-side dynamic web page is a web page whose construction is controlled by an application ...
on the
World Wide Web The World Wide Web (WWW or simply the Web) is an information system that enables Content (media), content sharing over the Internet through user-friendly ways meant to appeal to users beyond Information technology, IT specialists and hobbyis ...
, and it is increasingly being used for server-side applications and services using runtime environments such as Node.js, Deno and
Bun A bun is a type of bread that is round and small enough that it can generally be eaten hand-held. Whether a bun is considered sweetened or unsweetened differs between countries: it is considered sweetened in the United Kingdom, a savory bread in ...
.


ECMAScript, ECMA-262, JavaScript

ECMA-262, or the ''ECMAScript Language Specification'', defines the ''ECMAScript Language'', or just ECMAScript. ECMA-262 specifies only language syntax and the semantics of the core application programming interface (
API An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build ...
), such as , , and , while valid implementations of JavaScript add their own functionality such as
input/output In computing, input/output (I/O, i/o, or informally io or IO) is the communication between an information processing system, such as a computer, and the outside world, such as another computer system, peripherals, or a human operator. Inputs a ...
and file system handling.


History

The ECMAScript specification is a standardized specification of a scripting language developed by
Brendan Eich Brendan Eich ( ; born July 4, 1961) is an American computer programmer and technology executive. He created the JavaScript programming language and co-founded the Mozilla project, the Mozilla Foundation, and the Mozilla Corporation. He serve ...
of
Netscape Netscape Communications Corporation (originally Mosaic Communications Corporation) was an American independent computer services company with headquarters in Mountain View, California, and then Dulles, Virginia. Its Netscape web browser was o ...
; initially named Mocha, then LiveScript, and finally JavaScript. In December 1995,
Sun Microsystems Sun Microsystems, Inc., often known as Sun for short, was an American technology company that existed from 1982 to 2010 which developed and sold computers, computer components, software, and information technology services. Sun contributed sig ...
and Netscape announced JavaScript in a press release. In November 1996, Netscape announced a meeting of the
Ecma International Ecma International () is a Nonprofit organization, nonprofit standards organization for information and communication systems. It acquired its current name in 1994, when the European Computer Manufacturers Association (ECMA) changed its name to ...
standards organization to advance the standardization of JavaScript. The first edition of ECMA-262 was adopted by the Ecma General Assembly in June 1997. Several editions of the language standard have been published since then. The name "ECMAScript" was a compromise between the organizations involved in standardizing the language, especially Netscape and Microsoft, whose disputes dominated the early standards sessions. Eich commented that "ECMAScript was always an unwanted trade name that sounds like a
skin disease A skin condition, also known as cutaneous condition, is any medical condition that affects the integumentary system—the organ system that encloses the body and includes skin, Nail (anatomy), nails, and related muscle and glands. The major funct ...
." ECMAScript has been formalized through operational semantics by work at
Stanford University Leland Stanford Junior University, commonly referred to as Stanford University, is a Private university, private research university in Stanford, California, United States. It was founded in 1885 by railroad magnate Leland Stanford (the eighth ...
and the Department of Computing,
Imperial College London Imperial College London, also known as Imperial, is a Public university, public research university in London, England. Its history began with Prince Albert of Saxe-Coburg and Gotha, Prince Albert, husband of Queen Victoria, who envisioned a Al ...
for security analysis and standardization. "ECMA" stood for "European Computer Manufacturers Association" until 1994.


Evolution

Ecma's Technical Committee 39 (TC39) is responsible for the maintenance of ECMAScript. New proposals to the language go through a staged process, with each stage representing the completeness of the proposal's specification. Consensus must be reached within the committee to advance a proposal to the next stage. Proposals that reach stage 4, the final stage, will be included into the next version of the standard. Since the release of version 6 in June 2015, new major versions have been finalized and published every June.


Features

The ECMAScript language includes
structured Structuring, also known as smurfing in banking jargon, is the practice of executing financial transactions such as making bank deposits in a specific pattern, calculated to avoid triggering financial institutions to file reports required by law ...
, dynamic, functional, and prototype-based features.


Imperative and structured

ECMAScript JavaScript supports C-style structured programming. Previously, JavaScript only supported function scoping using the keyword var, but ECMAScript 2015 added the keywords let and const, allowing JavaScript to support both block scoping and function scoping. JavaScript supports
automatic semicolon insertion Lexical tokenization is conversion of a text into (semantically or syntactically) meaningful ''lexical tokens'' belonging to categories defined by a "lexer" program. In case of a natural language, those categories include nouns, verbs, adjectives ...
, meaning that semicolons that normally terminate a statement in C may be omitted in JavaScript. Like C-style languages,
control flow In computer science, control flow (or flow of control) is the order in which individual statements, instructions or function calls of an imperative program are executed or evaluated. The emphasis on explicit control flow distinguishes an '' ...
is done with the , , / , / , and statements. Functions are weakly typed and may accept and return any type. Arguments not provided default to .


Weakly typed

ECMAScript is weakly typed. This means that certain types are assigned implicitly based on the operation being performed. However, there are several quirks in JavaScript's implementation of the conversion of a variable from one type to another. These quirks have been the subject of a talk entitled ''Wat''.


Dynamic

ECMAScript is dynamically typed. Thus, a type is associated with a value rather than an expression. ECMAScript supports various ways to test the type of objects, including
duck typing In computer programming, duck typing is an application of the duck test—"If it walks like a duck and it quacks like a duck, then it must be a duck"—to determine whether an object can be used for a particular purpose. With nominative ...
.


Transpiling

Since ES 2015, transpiling JavaScript has become very common. Transpilation is a source-to-source compilation in which newer versions of JavaScript are used, and a transpiler rewrites the source code so that it is supported by older browsers. Usually, transpilers transpile down to ES3 to maintain compatibility with all versions of browsers. The settings to transpile to a specific version can be configured according to need. Transpiling adds an extra step to the build process and is sometimes done to avoid needing polyfills. Polyfills create new features for older environments that lack them. Polyfills do this at runtime in the interpreter, such as the user's browser or on the server. Instead, transpiling rewrites the ECMA code itself during the build phase of development before it reaches the interpreter.


Conformance

In 2010, Ecma International started developing a standards test for Ecma 262 ECMAScript. Test262 is an ECMAScript conformance test suite that can be used to check how closely a JavaScript implementation follows the ECMAScript Specification. The test suite contains thousands of individual tests, each of which tests some specific requirement(s) of the ECMAScript specification. The development of Test262 is a project of the Ecma Technical Committee 39 (TC39). The testing framework and the individual tests are contributed to Ecma by member organizations of TC39. Important contributions were made by Google ( Sputnik test suite) and Microsoft, who both contributed thousands of tests. The Test262 test suite consisted of tests . ECMAScript specifications through ES7 are well-supported in major
web browser A web browser, often shortened to browser, is an application for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's scr ...
s. The table below shows the conformance rate for current versions of software with respect to the most recent editions of ECMAScript.


See also

*
ECMAScript for XML ECMAScript for XML (E4X) was an extension to ECMAScript (which includes ActionScript, JavaScript, and JScript) to add native support for XML. The goal was to provide a simpler alternative to the DOM interface for accessing XML documents. E4X added ...
(E4X) * List of ECMAScript engines


References

{{List of IEC standards Ecma standards Object-based programming languages Programming languages with an ISO standard Scripting languages Source-to-source compilers