ECMAScript, ECMA-262 and 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 API, such as , , and , while valid implementations of JavaScript add their own functionality such as input-output and file-system handling.History
The ECMAScript specification is a standardized specification of a scripting language developed by Brendan Eich ofVersion history
Features
The ECMAScript language includes structured, dynamic,Imperative and structured
ECMAScript JavaScript supports C style structured programming. Previously, JavaScript only supported function scoping using the keywordvar
, but ECMAScript 2015 added the keywords let
and const
allowing JavaScript to support both block scoping and function scoping. JavaScript supports automatic semicolon insertion, meaning that semicolons that are normally used to terminate a statement in C may be omitted in JavaScript.
Like C-style languages, control flow 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 isDynamic
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.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 transpiling 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 individual tests are created by member organizations of TC39 and contributed to Ecma for use in Test262. Important contributions were made by Google (Sputnik testsuite) and Microsoft who both contributed thousands of tests. The Test262 testsuite consisted of tests . ECMAScript specifications through ES7 are well-supported in major web browsers. 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 (E4X) * JavaScript * JScript * List of ECMAScript enginesReferences
{{List of International Electrotechnical Commission standards Computer-related introductions in 1997 C programming language family Computer standards Dynamically typed programming languages Ecma standards JavaScript dialect engines JavaScript programming language family Object-based programming languages Programming languages with an ISO standard Prototype-based programming languages Scripting languages Source-to-source compilers