ECMAScript (source code)

= ECMAScript
{c}

<ECMAScript> is the standardized core language underlying <JavaScript>. It specifies grammar, values, built-in objects and evaluation rules; a <JavaScript engine> implements those rules within a host environment. A <web browser>'s <Document Object Model> facilities come from additional platform specifications rather than from the core language alone.<ECMAScript Language Specification by Ecma International>[§§1–2, Scope and Conformance; §4.2, Hosts and Implementations]{ref}

For example, the language-level computation `const a = {count: 1}; const b = a; b.count += 1; a.count` gives `2`: the two bindings refer to the same object. Copying the binding into `b` did not make a separate copy of the object's contents. This computation needs no <DOM elements>.

Contrast `document.createElement("p")`. The property access and function-call syntax belong to <ECMAScript>, but the supplied `document` object and its element-creation behavior come from the host's <Document Object Model>. A language expression can be syntactically valid even when an environment has not provided a referenced platform object.<DOM Standard by WHATWG>[Document interface, createElement]{ref}

<ECMAScript> also defines observable choices such as string concatenation versus numerical addition and the rules for <lexical scope>. These rules do not require every <JavaScript engine> to use the same internal representation or execution strategy. Reading a program requires distinguishing specified language behavior from the additional facilities supplied by its host.