2019-12

ECMAScript 2020: the final feature set

[2019-12-23] dev, javascript, es2020

Update 2020-04-02: Today, the ES2020 candidate was released, with the final feature set of that version. This blog post describes what’s new.

ECMAScript proposal: RegExp match indices

[2019-12-22] dev, javascript, es proposal

The ECMAScript proposal “RegExp match indices” (by Ron Buckton) adds more information to regular expression match objects (as returned by RegExp.prototype.exec() and other methods): They now record for each captured group where it starts and where it ends. Read on for more information.

ES2021: String.prototype.replaceAll

[2019-12-21] dev, javascript, es feature, es2021

The normal string method .replace() only lets you replace one occurrence if you search for string (and not a regular expression with the flag /g). The proposal “String.prototype.replaceAll (by Peter Marshall, Jakob Gruber, Mathias Bynens) fixes that.

ES2021: Promise.any()

[2019-12-20] dev, javascript, es2021

The ECMAScript proposal “Promise.any()” (by Mathias Bynens, Kevin Gibbons, and Sergey Rubanov) introduces a new Promise combinator for JavaScript. This blog post explains how it works.

ECMAScript proposal: top-level await

[2019-12-19] dev, javascript, es proposal

The ECMAScript proposal “Top-level await by Myles Borins lets you use the asynchronous await operator at the top level of modules. Before, you could only use it in async functions and async generators.

Synching into cloud directories (Dropbox etc.) to ignore node_modules

[2019-12-17] dev, nodejs

In this blog post, I describe how you can ignore node_modules by bidirectionally syncing into a cloud directory (as managed via Dropbox etc.).

2019-11

Techniques for instantiating classes

[2019-11-11] dev, javascript, oop

In this blog post, we examine several approaches for creating instances of classes: Constructors, factory functions, etc. We do so by solving one concrete problem several times. The focus of this post is on classes, which is why alternatives to classes are ignored.

Easier Node.js streams via async iteration

[2019-11-07] dev, javascript, nodejs, async

Working with Node.js streams is much more pleasant if we use asynchronous iteration. This blog post explores how to do that.

Attributes of object properties in JavaScript

[2019-11-03] dev, javascript, oop

In this blog post, we take a closer look at how the ECMAScript specification sees JavaScript objects. In particular, properties are not atomic in the spec, but composed of multiple attributes (think fields in a record). Even the value of a data property is stored in an attribute!

2019-10

Type coercion in JavaScript

[2019-10-31] dev, javascript, es spec

In this blog post, we examine the role of type coercion in JavaScript. We will go relatively deeply into this subject and, e.g., look into how the ECMAScript specification handles coercion.