Misplaced Pages

ECMAScript version history

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

ECMAScript is a JavaScript standard developed by Ecma International . Since 2015, major versions have been published every June.

#771228

66-512: ECMAScript 2024, the 15th and current version, was released in June 2024. In June 2004, Ecma International published ECMA-357 standard, defining an extension to ECMAScript, known as ECMAScript for XML (E4X). Ecma also defined a "Compact Profile" for ECMAScript – known as ES-CP, or ECMA 327 – that was designed for resource-constrained devices, which was withdrawn in 2015. The proposed fourth edition of ECMA-262 ( ECMAScript 4 or ES4 ) would have been

132-750: A configuration language . However, it does not support comments . In 2012, Douglas Crockford, JSON creator, had this to say about comments in JSON when used as a configuration language: "I know that the lack of comments makes some people sad, but it shouldn't. Suppose you are using JSON to keep configuration files, which you would like to annotate. Go ahead and insert all the comments you like. Then pipe it through JSMin before handing it to your JSON parser." MongoDB uses JSON-like data for its document-oriented database . Some relational databases, such as PostgreSQL and MySQL, have added support for native JSON data types. This allows developers to store JSON data directly in

198-455: A JSON-based format to define the structure of JSON data for validation, documentation, and interaction control. It provides a contract for the JSON data required by a given application and how that data can be modified. JSON Schema is based on the concepts from XML Schema (XSD) but is JSON-based. As in XSD, the same serialization/deserialization tools can be used both for the schema and data, and it

264-411: A Web server by holding two Hypertext Transfer Protocol (HTTP) connections open and recycling them before standard browser time-outs if no further data were exchanged. The cofounders had a round-table discussion and voted on whether to call the data format JSML (JavaScript Markup Language) or JSON (JavaScript Object Notation), as well as under what license type to make it available. The JSON.org website

330-404: A convenient alternative to Object.prototype.hasOwnProperty . The 14th edition, ECMAScript 2023, was published in June 2023. This version introduces the toSorted , toReversed , with , findLast , and findLastIndex methods on Array.prototype and TypedArray.prototype , as well as the toSpliced method on Array.prototype ; added support for #! shebang comments at

396-520: A debate between Eich, later the Mozilla Foundation 's CTO, and Chris Wilson , Microsoft 's platform architect for Internet Explorer , became public on a number of blogs . Wilson cautioned that because the proposed changes to ECMAScript made it backwards incompatible in some respects to earlier versions of the language, the update amounted to "breaking the Web", and that stakeholders who opposed

462-510: A double-precision 64-bit IEEE 754 value. The built-in functions in Math are not compatible with BigInts; for example, exponentiation of BigInts must be done with the ** operator instead of Math.pow . The nullish coalescing operator, ?? , returns its right-hand side operand when its left-hand side is null or undefined . This contrasts with the || operator, which would return "string" for all "falsy" values, such as

528-463: A less ambitious update of ECMAScript 3, tentatively named ECMAScript 3.1. This edition would focus on security and library updates, with a large emphasis on compatibility. After the aforementioned public sparring, the ECMAScript 3.1 and ECMAScript 4 teams agreed on a compromise: the two editions would be worked on, in parallel, with coordination between the teams to ensure that ECMAScript 3.1 remains

594-466: A new compromise in July 2008: Brendan Eich announced that Ecma TC39 would focus work on the ECMAScript 3.1 (later renamed to ECMAScript, 5th Edition) project with full collaboration of all parties, and vendors would target at least two interoperable implementations by early 2009. In April 2009, Ecma TC39 published the "final" draft of the 5th edition and announced that testing of interoperable implementations

660-467: A practice which would have destroyed interoperability." JSON disallows "trailing commas", a comma after the last value inside a data structure. Trailing commas are a common feature of JSON derivatives to improve ease of use. RFC 8259 describes certain aspects of JSON syntax that, while legal per the specifications, can cause interoperability problems. In 2015, the IETF published RFC 7493, describing

726-647: A project code named ECMAScript Harmony . Features under discussion for Harmony at the time included: The intent of these features was partly to better support programming in the large , and to allow sacrificing some of the script's ability to be dynamic to improve performance. For example, Tamarin – the virtual machine for ActionScript, developed and open-sourced by Adobe – has just-in-time compilation (JIT) support for certain classes of scripts. In addition to introducing new features, some ES3 bugs were proposed to be fixed in edition 4. These fixes and others, and support for JSON encoding/decoding, have been folded into

SECTION 10

#1732787082772

792-528: A promise combinator that short-circuits when an input value is fulfilled; AggregateError , a new error type to represent multiple errors at once; logical assignment operators ( ??= , &&= , ||= ); WeakRef , for referring to a target object without preserving it from garbage collection, and FinalizationRegistry , to manage registration and unregistration of cleanup operations performed when target objects are garbage collected; separators for numeric literals ( 1_000 ); and Array.prototype.sort

858-572: A relational database without having to convert it to another data format. JSON being a subset of JavaScript can lead to the misconception that it is safe to pass JSON texts to the JavaScript eval () function. This is not safe, due to certain valid JSON texts, specifically those containing U+2028 LINE SEPARATOR or U+2029 PARAGRAPH SEPARATOR , not being valid JavaScript code until JavaScript specifications were updated in 2019, and so older engines may not support it. To avoid

924-424: A replacement for XML-RPC or SOAP . It is a simple protocol that defines only a handful of data types and commands. JSON-RPC lets a system send notifications (information to the server that does not require a response) and multiple calls to the server that can be answered out of order. Asynchronous JavaScript and JSON (or AJAJ) refers to the same dynamic web page methodology as Ajax , but instead of XML , JSON

990-652: A simpler syntax similar to languages like Python, F#, Perl, and Ruby. async / await was hailed as an easier way to use promises and develop asynchronous code. The 8th edition, or ECMAScript 2017, was finalized in June 2017. Its features include the Object.values , Object.entries and Object.getOwnPropertyDescriptors functions for easy manipulation of Objects, async / await constructions that use generators and promises, and additional features for concurrency and atomics . It also includes String.prototype.padStart() . The 9th edition, or ECMAScript 2018,

1056-469: A single value and each attribute can appear at most once on each element. XML separates "data" from "metadata" (via the use of elements and attributes), while JSON does not have such a concept. Another key difference is the addressing of values. JSON has objects with a simple "key" to "value" mapping, whereas in XML addressing happens on "nodes", which all receive a unique ID via the XML processor. Additionally,

1122-491: A strict subset of ECMAScript 4 in both semantics and syntax. However, the differing philosophies in each team resulted in repeated breakages of the subset rule, and it remained doubtful that the ECMAScript 4 dissenters would ever support or implement ECMAScript 4 in the future. After over a year since the disagreement over the future of ECMAScript within the Ecma Technical Committee 39, the two teams reached

1188-964: A syntax error. The 6th edition, ECMAScript 6 ( ES6 ) and later renamed to ECMAScript 2015, was finalized in June 2015. This update adds significant new syntax for writing complex applications, including class declarations ( class Foo { ... } ), ES6 modules like import * as moduleName from "..." ; export const Foo , but defines them semantically in the same terms as ECMAScript 5 strict mode. Other new features include iterators and for ... of loops, Python -style generators, arrow function expression ( () => {...} ), let keyword for local declarations, const keyword for constant local declarations, binary data, typed arrays, new collections (maps, sets and WeakMap), promises , number and math enhancements, reflection, proxies (metaprogramming for virtual objects and wrappers) and template literals using backticks ( ` ) for multi-line strings without escape characters . The complete list

1254-553: A system. The system was sold to Sun Microsystems , Amazon.com , and EDS . JSON was based on a subset of the JavaScript scripting language (specifically, Standard ECMA -262 3rd Edition—December 1999 ) and is commonly used with JavaScript, but it is a language-independent data format. Code for parsing and generating JSON data is readily available in many programming languages . JSON's website lists JSON libraries by language. In October 2013, Ecma International published

1320-510: A valid JSON text must consist of only an object or an array type, which could contain other types within them. This restriction was dropped in RFC   7158 , where a JSON text was redefined as any serialized value. Numbers in JSON are agnostic with regard to their representation within programming languages. While this allows for numbers of arbitrary precision to be serialized, it may lead to portability issues. For example, since no differentiation

1386-400: Is a commonly used data format with diverse uses in electronic data interchange , including that of web applications with servers . JSON is a language-independent data format. It was derived from JavaScript , but many modern programming languages include code to generate and parse JSON-format data. JSON filenames use the extension .json . Douglas Crockford originally specified

SECTION 20

#1732787082772

1452-514: Is allowed and ignored around or between syntactic elements (values and punctuation, but not within a string value). Four specific characters are considered whitespace for this purpose: space , horizontal tab , line feed , and carriage return . In particular, the byte order mark must not be generated by a conforming implementation (though it may be accepted when parsing JSON). JSON does not provide syntax for comments . Early versions of JSON (such as specified by RFC   4627 ) required that

1518-470: Is also owned by 3DO ). Upon discovery of early Ajax capabilities, digiGroups, Noosh, and others used frames to pass information into the user browsers' visual field without refreshing a Web application's visual context, realizing real-time rich Web applications using only the standard HTTP, HTML, and JavaScript capabilities of Netscape 4.0.5+ and Internet Explorer 5+. Crockford then found that JavaScript could be used as an object-based messaging format for such

1584-520: Is also valid JavaScript syntax. The specification was started in 2012 and finished in 2018 with version 1.0.0. The main differences to JSON syntax are: JSON5 syntax is supported in some software as an extension of JSON syntax, for instance in SQLite . JSONC (JSON with Comments) is a subset of JSON5 used in Microsoft's Visual Studio Code : Several serialization formats have been built on or from

1650-490: Is extensive. As the first "ECMAScript Harmony" specification, it is also known as "ES6 Harmony". The 7th edition, or ECMAScript 2016, was finalized in June 2016. Its features include exponentiation operator ** for numbers, await , async keywords for asynchronous programming (as a preparation for ES2017), and the Array.prototype.includes function. The exponentiation operator is equivalent to Math.pow , but provides

1716-422: Is made between integer and floating-point values, some implementations may treat 42 , 42.0 , and 4.2E+1 as the same number, while others may not. The JSON standard makes no requirements regarding implementation details such as overflow , underflow , loss of precision, rounding, or signed zeros , but it does recommend expecting no more than IEEE 754 binary64 precision for "good interoperability". There

1782-405: Is necessary is the serialization of data types that are not part of the JSON standard, for example, dates and regular expressions . The official MIME type for JSON text is application/json , and most modern implementations have adopted this. Legacy MIME types include text/json , text/x-json , and text/javascript . The standard filename extension is .json. JSON Schema specifies

1848-535: Is no inherent precision loss in serializing a machine-level binary representation of a floating-point number (like binary64) into a human-readable decimal representation (like numbers in JSON) and back since there exist published algorithms to do this exactly and optimally. Comments were intentionally excluded from JSON. In 2012, Douglas Crockford described his design decision thus: "I removed comments from JSON because I saw people were using them to hold parsing directives,

1914-401: Is not a data interchange language. CBOR has a superset of the JSON data types, but it is not text-based. Ion is also a superset of JSON, with a wider range of primary types, annotations, comments, and allowing trailing commas. XML has been used to describe structured data and to serialize objects. Various XML-based protocols exist to represent the same kind of data structures as JSON for

1980-465: Is not the fifth version of JSON). YAML version 1.2 is a superset of JSON; prior versions were not strictly compatible. For example, escaping a slash / with a backslash \ is valid in JSON, but was not valid in YAML. YAML supports comments, while JSON does not. CSON (" CoffeeScript Object Notation") uses significant indentation , unquoted keys, and assumes an outer object declaration. It

2046-433: Is now guaranteed to be stable , meaning that elements with equal sorting keys will not change relative order before and after the sort operation. Array.prototype.flat(depth=1) flattens an array to a specified depth, meaning that all subarray elements (up to the specified depth) are concatenated recursively. Another notable change is that so-called catch binding became optional. The 11th edition, or ECMAScript 2020,

ECMAScript version history - Misplaced Pages Continue

2112-452: Is self-describing. It is specified in an Internet Draft at the IETF, with the latest version as of 2024 being "Draft 2020-12". There are several validators available for different programming languages, each with varying levels of conformance. The JSON standard does not support object references , but an IETF draft standard for JSON-based object references exists. JSON-RPC is a remote procedure call (RPC) protocol built on JSON, as

2178-589: Is the current version of the Internet Standard STD 90, and it remains consistent with ECMA-404. That same year, JSON was also standardized as ISO/IEC 21778:2017. The ECMA and ISO/IEC standards describe only the allowed syntax, whereas the RFC covers some security and interoperability considerations. JSON grew out of a need for a real-time server-to-browser session communication protocol without using browser plugins such as Flash or Java applets,

2244-472: Is the data format. AJAJ is a web development technique that provides for the ability of a web page to request new data after it has loaded into the web browser . Typically, it renders new data from the server in response to user actions on that web page. For example, what the user types into a search box , client-side code then sends to the server, which immediately responds with a drop-down list of matching database items. JSON has seen ad hoc usage as

2310-406: The #x in obj syntax, to test for presence of private fields on objects; regular expression match indices via the /d flag, which provides start and end indices for matched substrings; the cause property on Error objects, which can be used to record a causation chain in errors; the at method for Strings, Arrays, and TypedArrays, which allows relative indexing; and Object.hasOwn ,

2376-551: The Internet Engineering Task Force obsoleted RFC   7159 when it published RFC   8259 , which is the current version of the Internet Standard STD 90. Crockford added a clause to the JSON license stating, "The Software shall be used for Good, not Evil", in order to open-source the JSON libraries while mocking corporate lawyers and those who are overly pedantic. On the other hand, this clause led to license compatibility problems of

2442-523: The Unicode line terminators U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR to appear unescaped in quoted strings, while ECMAScript 2018 and older do not. This is a consequence of JSON disallowing only "control characters". For maximum portability, these characters should be backslash-escaped. JSON exchange in an open ecosystem must be encoded in UTF-8 . The encoding supports

2508-411: The "I-JSON Message Format", a restricted profile of JSON that constrains the syntax and processing of JSON to avoid, as much as possible, these interoperability issues. While JSON provides a syntactic framework for data interchange, unambiguous data interchange also requires agreement between producer and consumer on the semantics of specific use of the JSON syntax. One example of where such an agreement

2574-578: The ECMAScript, 5th Edition specification. Work started on Edition 4 after the ES-CP (Compact Profile) specification was completed, and continued for approximately 18 months where slow progress was made balancing the theory of Netscape's JavaScript 2 specification with the implementation experience of Microsoft's JScript .NET. After some time, the focus shifted to the ECMAScript for XML (E4X) standard. The update has not been without controversy. In late 2007,

2640-517: The JSON format in the early 2000s. He and Chip Morningstar sent the first JSON message in April 2001. The 2017 international standard (ECMA-404 and ISO/IEC 21778:2017) specifies that "JSON" is "pronounced / ˈ dʒ eɪ . s ə n / , as in ' Jason and The Argonauts ' ". The first (2013) edition of ECMA-404 did not address the pronunciation. The UNIX and Linux System Administration Handbook states, " Douglas Crockford , who named and promoted

2706-423: The JSON format, says it's pronounced like the name Jason. But somehow, 'JAY-sawn' seems to have become more common in the technical community." Crockford said in 2011, "There's a lot of argument about how you pronounce that, but I strictly don't care." After RFC 4627 had been available as its "informational" specification since 2006, JSON was first standardized in 2013, as ECMA -404. RFC 8259, published in 2017,

ECMAScript version history - Misplaced Pages Continue

2772-438: The JSON license with other open-source licenses since open-source software and free software usually imply no restrictions on the purpose of use. The following example shows a possible JSON representation describing a person. Although Crockford originally asserted that JSON is a strict subset of JavaScript and ECMAScript , his specification actually allows valid JSON documents that are not valid JavaScript; JSON allows

2838-569: The JavaScript engine used in the Flash virtual machine. However, it is not supported by other common engines like Nitro ( Safari ), V8 ( Google Chrome ), Carakan ( Opera ), and Chakra ( Internet Explorer and pre-Chromium Edge ). E4X was supported by SpiderMonkey (used in Firefox and Thunderbird ). However, E4X was deprecated in Firefox 10 and eventually removed in Firefox 21. E4X

2904-648: The Mozilla Foundation in 2014, and it was withdrawn by ISO/IEC in 2021. The first implementation of E4X was designed by Terry Lucas and John Schneider and appeared in BEA 's Weblogic Workshop 7.0, released in February 2002. BEA's implementation was based on Rhino and released before the ECMAScript E4X spec was completed in June 2004. E4X is supported by Mozilla's Rhino , as well as by Tamarin ,

2970-447: The XML standard defines a common attribute xml:id , that can be used by the user, to set an ID explicitly. XML tag names cannot contain any of the characters !"#$ %&'()*+,/;<=>?@[\]^`{|}~ , nor a space character, and cannot begin with - , . , or a numeric digit, whereas JSON keys can (even if quotation mark and backslash must be escaped). XML values are strings of characters , with no built-in type safety . XML has

3036-444: The beginning of files to better facilitate executable ECMAScript files; and allowed the use of most Symbols as keys in weak collections. The 15th edition, ECMAScript 2024, was published in June 2024. This version introduces the Object.groupBy and Map.groupBy static methods, Promise.withResolvers , and the /v unicode flag for regular expressions. The Object.groupBy and Map.groupBy methods groups an iterable using

3102-526: The changes were being "hidden from view". Eich responded by stating that Wilson seemed to be "repeating falsehoods in blogs" and denied that there was attempt to suppress dissent and challenged critics to give specific examples of incompatibility. He pointed out that Microsoft Silverlight and Adobe AIR rely on C# and ActionScript 3 respectively, both of which are larger and more complex than ECMAScript Edition 3. Yahoo, Microsoft, Google, and other 4th edition dissenters formed their own subcommittee to design

3168-553: The concept of schema , that permits strong typing, user-defined types, predefined tags, and formal structure, allowing for formal validation of an XML stream. JSON has several types built-in and has a similar schema concept in JSON Schema . XML supports comments, while JSON does not. Support for comments and other features have been deemed useful, which has led to several nonstandard JSON supersets being created. Among them are HJSON, HOCON, and JSON5 (which despite its name,

3234-475: The dominant methods used in the early 2000s. Crockford first specified and popularized the JSON format. The acronym originated at State Software, a company cofounded by Crockford and others in March 2001. The cofounders agreed to build a system that used standard browser capabilities and provided an abstraction layer for Web developers to create stateful Web applications that had a persistent duplex connection to

3300-437: The first edition of its JSON standard ECMA-404. That same year, RFC   7158 used ECMA-404 as a reference. In 2014, RFC   7159 became the main reference for JSON's Internet uses, superseding RFC   4627 and RFC   7158 (but preserving ECMA-262 and ECMA-404 as main references). In November 2017, ISO/IEC JTC 1/SC 22 published ISO/IEC 21778:2017 as an international standard. On December 13, 2017,

3366-400: The first major update to ECMAScript since the third edition was published in 1999. The specification (along with a reference implementation) was originally targeted for completion by October 2008. The first draft was dated February 1999. An overview of the language was released by the working group on 23 October 2007. By August 2008, the ECMAScript 4th edition proposal had been scaled back into

SECTION 50

#1732787082772

3432-616: The full Unicode character set, including those characters outside the Basic Multilingual Plane (U+0000 to U+FFFF). However, if escaped, those characters must be written using UTF-16 surrogate pairs . For example, to include the Emoji character U+1F610 😐 NEUTRAL FACE in JSON: JSON became a strict subset of ECMAScript as of the language's 2019 revision. JSON's basic data types are: Whitespace

3498-481: The language's 2019 revision. Various JSON parser implementations have suffered from denial-of-service attack and mass assignment vulnerability . JSON is promoted as a low-overhead alternative to XML as both of these formats have widespread support for creation, reading, and decoding in the real-world situations where they are commonly used. Apart from XML, examples could include CSV and supersets of JSON. Google Protocol Buffers can fill this role, although it

3564-520: The many pitfalls caused by executing arbitrary code from the Internet, a new function, JSON . parse () , was first added to the fifth edition of ECMAScript, which as of 2017 is supported by all major browsers. For non-supported browsers, an API-compatible JavaScript library is provided by Douglas Crockford . In addition, the TC39 proposal "Subsume JSON" made ECMAScript a strict JSON superset as of

3630-521: The next version is at the time of writing. ES.Next features include finished proposals (aka "stage 4 proposals") as listed at finished proposals that are not part of a ratified specification. The language committee follows a "living spec" model, so these changes are part of the standard, and ratification is a formality. 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

3696-425: The ones below. Optional chaining makes it possible to access the nested properties of an object without having an AND check at each level. An example is const zipcode = person?.address?.zipcode . If any of the properties are not present, zipcode will be undefined . The 12th edition, ECMAScript 2021, was published in June 2021. This version introduces the replaceAll method for strings; Promise.any ,

3762-433: The return value of a provided callback function. Promise.withResolvers provides a simple way to get a promise's resolve and reject functions directly without having to assign them in the constructor. The /v flag in regular expressions is simply an improved version of the /u flag, but as it makes backwards-incompatible changes it had to be introduced as a new flag. ES.Next is a dynamic name that refers to whatever

3828-427: The same kind of data interchange purposes. Data can be encoded in XML in several ways. The most expansive form using tag pairs results in a much larger (in character count) representation than JSON, but if data is stored in attributes and 'short tag' form where the closing tag is replaced with /> , the representation is often about the same size as JSON or just a little larger. However, an XML attribute can only have

3894-483: Was expected to be completed by mid-July. On December 3, 2009, ECMA-262 5th edition was published. Additions include JSON , String.trim() to easily remove whitespaces surrounding a string ( " example " to "example" ), String.charAt() to return a single character from a given position in a string, and Array.isArray() . A comma after the final pair of values in an object ( var example = { "property1":"value1", "property2":"value2", } ) also no longer causes

3960-531: Was finalized in June 2018. New features include the spread operator and rest parameters ( ... ) for object literals, asynchronous iteration, Promise.prototype.finally and additions to RegExp. The spread operator allows for the easy copying of object properties, as shown below. The 10th edition, or ECMAScript 2019, was published in June 2019. Added features include, but are not limited to, Array.prototype.flat , Array.prototype.flatMap , changes to Array.sort , and Object.fromEntries . Array.sort

4026-493: Was launched in 2001. In December 2005, Yahoo! began offering some of its Web services in JSON. A precursor to the JSON libraries was used in a children's digital asset trading game project named Cartoon Orbit at Communities.com (the State cofounders had all worked at this company previously) for Cartoon Network , which used a browser side plug-in with a proprietary messaging format to manipulate DHTML elements (this system

SECTION 60

#1732787082772

4092-528: Was made more precise, reducing the number of cases that result in an implementation-defined sort order. The 13th edition, ECMAScript 2022, was published in June 2022. This version introduces top-level await , allowing the keyword to be used at the top level of modules; new class elements: public and private instance fields, public and private static fields, private instance methods and accessors, and private static methods and accessors; static blocks inside classes, to perform per-class evaluation initialization;

4158-519: Was published in June 2020. In addition to new functions, this version introduces a BigInt primitive type for arbitrary-sized integers, the nullish coalescing operator , and the globalThis object . BigInts are created either with the BigInt constructor or with the syntax 10n , where "n" is placed after the number literal. BigInts allow the representation and manipulation of integers beyond Number.MAX_SAFE_INTEGER , while Numbers are represented by

4224-457: Was supported by the OpenOffice.org software suite. JSON JSON ( JavaScript Object Notation , pronounced / ˈ dʒ eɪ s ən / or / ˈ dʒ eɪ ˌ s ɒ n / ) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of name–value pairs and arrays (or other serializable values). It

4290-615: Was to provide a simpler alternative to the DOM interface for accessing XML documents. E4X added XML as a primitive data structure to allow for faster access and better support within the language. E4X was standardized by Ecma International in the ECMA-357 standard . The first edition was published in June 2004 and the second edition in December 2005. However, the E4X standard was deprecated by

4356-426: Was used for configuring GitHub 's Atom text editor . There is also an unrelated project called CSON ("Cursive Script Object Notation") that is more syntactically similar to JSON. HOCON ("Human-Optimized Config Object Notation") is a format for human-readable data, and a superset of JSON. The uses of HOCON are: JSON5 ("JSON5 Data Interchange Format") is an extension of JSON syntax that, just like JSON,

#771228