ECMAScript: Difference between revisions

Content deleted Content added
m Reverted 1 edit by Andres.miranda1 (talk) to last revision by Stephenamills
No edit summary
Line 48:
|archive-url = https://web.archive.org/web/20160610005241/https://books.google.com/books?id=WTZqecc9olUC
|url-status = live
}}</ref> is a standard for scripting languages, including [[JavaScript]], [[JScript]], and [[ActionScript]]. It is also best known as a [[JavaScript]] standard intended to ensure the [[interoperability]] of [[web page]]s across different [[web browser]]s.<ref>{{cite journal |last1=Wirfs-Brock |first1=Allen |last2=Eich |first2=Brendan |date=2020-05-02 |year=2020 |title=JavaScript: The First 20 Years |journal=Proceedings of the ACM on Programming Languages |volume=4 |pages=1–189 |doi=10.1145/3386327 |doi-access=free |s2cid=219603695}}</ref> It is standardized by [[Ecma International]] in the document [https://www.ecma-international.org/publications-and-standards/standards/ecma-262/ ECMA-262].
 
ECMAScript is commonly used for [[client-side scripting]] on the [[World Wide Web]], and it is increasingly being used to writefor server-side applications and services using [[Node.js]] and other runtime environments.{{Cn|date=April 2023}}
 
== ECMAScript, ECMA-262, JavaScript ==
Line 68:
 
=== Imperative and structured ===
ECMAScript JavaScript<!-- How to make clearer? --> supports [[C (programming language)|C]] -style structured programming. Previously, JavaScript only supported [[Scope (computer science)|function scoping]] using the keyword <code>var</code>, but ECMAScript 2015 added the keywords <code>let</code> and <code>const</code>, 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.<!-- Might imply EMCAScript doesn't support automatic semicolon insertion --><ref name="Flanagan2006">{{cite book|url=https://books.google.com/books?id=2weL0iAfrEMC|title=JavaScript: The Definitive Guide: The Definitive Guide|author=David Flanagan|date=17 August 2006|publisher="O'Reilly Media, Inc."|isbn=978-0-596-55447-7|page=16|access-date=11 November 2019|archive-date=1 August 2020|archive-url=https://web.archive.org/web/20200801065235/https://books.google.com/books?id=2weL0iAfrEMC|url-status=live}}</ref>
 
Like C-style languages, [[control flow]] is done with the {{Code|code=while}}, {{Code|code=for}}, {{Code|code=do}} / {{Code|code=while}}, {{Code|code=if}} / {{Code|code=else}}, and {{Code|code=switch}} statements.<!-- missing Labels / Functions --> Functions are weakly typed and may accept and return any type. Arguments not provided default to {{Code|code=undefined}}.
Line 86:
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 testsuite(JavaScript conformance test)|Sputnik test suite]]) and Microsoft, who both contributed thousands of tests.
The Test262 testsuitetest suite consisted of {{val|38014}} tests {{as of|2020|01|lc=y}}.<ref name="GitHub 2020">{{cite web | title=tc39/test262 | website=GitHub | date=January 24, 2020 | url=https://github.com/tc39/test262 | access-date=January 29, 2020 | archive-date=October 1, 2019 | archive-url=https://web.archive.org/web/20191001032806/https://github.com/tc39/test262 | url-status=live }}</ref> ECMAScript specifications through ES7 are well-supported in major [[web browser]]s. The table below shows the conformance rate for current versions of software with respect to the most recent editions of ECMAScript.
 
{| class="wikitable sortable"
Line 116:
== See also ==
* [[ECMAScript for XML]] (E4X)
* [[JavaScript]]
* [[JScript]]
* [[List of ECMAScript engines]]