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.
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.
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.