While the regex syntax might appear daunting at first, once you get the hang of it, you can accomplish tasks that would otherwise require dozens of lines of code. In this article, we’ll look at four new regex features in ECMAScript that help web developers write less error-prone and more efficient code.

Almost all popular programming languages support regular expressions, and there’s a good reason for that: regular expressions provide developers with remarkably powerful tools that enable them to quickly perform tasks that would otherwise require dozens of lines of code. In this article, we will look at six text processing and manipulation tasks that front-end developers often have to deal with and see how regular expressions simplify the process.

The different ways of referencing the global object have made it tough to write a portable JavaScript code that works in multiple environments. Fortunately, there’s a proposal in the works that aims to fix this issue by introducing a standard property called globalThis that will be available in all environments. In this article, we’ll first look at the global object in popular JavaScript environments and then see how globalThis provides a unified mechanism to access it.

In my recent post “How to make HTTP requests like a pro,” I discussed the benefits of using the Axios library. Nevertheless, it’s important to acknowledge that Axios is not always an ideal solution, and there are sometimes better options for making HTTP requests. Without question, some developers prefer Axios over built-in APIs for its ease of use. But many overestimate the need for such a library. The fetch() API is perfectly capable of reproducing the key features of Axios, and it has the added advantage of being readily available in all modern browsers.

Since its introduction in ECMAScript 2015, the Promise object has provided two methods for tracking the state of asynchronous tasks: Promise.all() and Promise.race(). Although these methods have opened new possibilities in JavaScript, there are still use cases that aren’t covered. To fill this gap, two additional methods are proposed to be added to the specification: Promise.allSettled() and Promise.any(). In this post, we’ll take a good look at new and existing promise methods (also known as promise combinators) and see how they differ.

In JavaScript, the Number type cannot safely represent integer values larger than 9007199254740991. This limitation has forced developers to use inefficient workarounds and third-party libraries. BigInt is a new data type that can represent integer values larger than the range supported by the Number type. The ability to represent integers with arbitrary precision is particularly important when performing mathematical operations on large integers. With BigInt, integer overflow will no longer be an issue. Additionally, you can safely work with high-resolution timestamps, large integer IDs, and more without having to use a workaround.

The most common way for frontend programs to communicate with servers is through the HTTP protocol. You are probably familiar with the Fetch API and the XMLHttpRequest interface, which allow you fetch resources and make HTTP requests. If you are using a JavaScript library, chances are it comes with a client HTTP API. jQuery’s $.ajax() function, for example, has been particularly popular with frontend developers. But as developers move away from such libraries in favor of native APIs, dedicated HTTP clients have emerged to fill the gap.

ECMAScript 2019 (or ES2019 for short) introduces exciting new features such as Object.fromEntries(), flat(), flatMap(), trimStart(), trimEnd(), description property for symbol objects, optional catch binding, and more. The good news is that these features have already been implemented in the latest versions of Firefox and Chrome, and they can also be transpiled so that older browsers are able to process them. In this post, we will take a good look at these features and see how they upgrade the language.