EcmaScript

Table of contents

Summarise with:

ECMAScript is a scripting language a standardised language that forms the basis on which various programming languages are built, being JavaScript the best known and most widely used. 

Established by ECMA International through the technical specification ECMA-262, ECMAScript defines how the language should behave in fundamental areas such as syntax, data types, control structures, object manipulation and error handling, amongst other aspects. Its main aim is to ensure that the various environments that implement JavaScript, such as browsers and servers, behave consistently.

Although the terms «ECMAScript» and «JavaScript» are often used interchangeably, it is important to note that JavaScript is a implementation of ECMAScript, which also includes additional functions specific to the environment in which it runs (such as DOM manipulation in browsers). Other implementations of the ECMAScript standard include ActionScript (used in Adobe Flash) and JScript (from Microsoft).

One of the language’s most powerful features is its support for regular expressions, a tool that allows you to work efficiently with text strings. For example, a regular expression such as /d+/g can be used to identify all the numbers in a text string. This is extremely useful for form validation, searching for patterns in data and text processing in general.

Since it was first published in 1997, ECMAScript has undergone numerous updates, known as ECMAScript versions, which have introduced significant improvements to the language. Some of the most notable versions are:

  • ECMAScript 5 (2009): introduced strict mode and new array functions.

  • ECMAScript 6 (ES6 or ECMAScript 2015): It was a revolution in the language, introducing features such as `let` and `const` for declaring variables, arrow functions (()=>{}), classes, modules and promises for asynchronous programming.

  • ECMAScript 2017: It introduced `async` and `await`, which further simplify the handling of asynchronous operations.

  • ECMAScript 2020 and later: they continue to evolve with features such as optional chaining (?.), nullish coalescing (??) and improvements to data types.

Below is a code example demonstrating various basic features of the ECMAScript language, with each feature explained in a comment preceding the code that implements it:

// Declaring variables using ES6

let name = «Carlos»;

const age = 30;

 

// Arrow function

const sayHello = (person) => `Hello, ${person}`;

console.log(greet(name));

 

// Using a regular expression

let text = «The temperature is 23 degrees»;

let numbers = text.match(/d+/g); // [«23»]

 

// Using promises and async/await

const getData = async () => {

  try {

    let response = await fetch(«https://api.ejemplo.com/datos»);

    let data = await response.json();

    console.log(data);

  } catch (error) {

    console.error(«Error retrieving data:», error);

  }

};

 

In short, ECMAScript is the backbone of modern web development. Thanks to its nature as scripting language, enables the creation of interactive, dynamic and powerful applications, and its constant evolution through new versions ensures that it keeps pace with developers’ needs. 

Whether it’s in the creation of websites, servers, mobile apps or even artificial intelligence tools, knowledge of ECMAScript and its implementations, such as the JavaScript language, is really important for any developer.

Share in:

Related articles

Routing

Routing is the process of determining the path that data must follow through a network to get from an origin to a destination. In the context of systems and networks, routing refers to how

Deployment

Deployment, especially in the context of DevOps, refers to the process of putting an application or service into a production environment, making it available to end users. DevOps, a combination of “development” and “operations”, is a methodology

Patch

In computing, a patch is a software update designed to fix bugs, improve functionality or increase security of a program or operating system. Patches are essential to comply with the best practices for maintenance of

Hallucination

When we talk about an artificial intelligence model, we understand by hallucination any false, misleading or illogical response generated by an AI model. It is called a hallucination, since the responses are based on information that the AI has misunderstood or that directly

Scroll to Top