These are lookaround assertions in regular expressions in JavaScript:
(?=«pattern»)
(?!«pattern»)
(?<=«pattern»)
(?<!«pattern»)
This blog post shows examples of using them.
In this blog post, we look at npm packages that contain both ES modules and CommonJS modules.
This blog post answers the following questions:
ts-loader
has one downside: We can’t pipe the output of another loader into it; it always reads the original file. As a work-around, we can use babel-loader
to compile TypeScript. This blog post explains how.
In a web app of mine, I wanted to let end users run multi-module JavaScript that they enter via text fields. It turns out that this simple idea is relatively difficult to implement. In this blog post, I’ll explain how to do it. It is less polished than usual – I mainly wanted to get the knowledge out there.
import()
The import()
operator lets us dynamically load ECMAScript modules. But they can also be used to evaluate JavaScript code (as Andrea Giammarchi recently pointed out to me), as an alternative to eval()
. This blog post explains how that works.
This blog post describes the ECMAScript feature proposal “Nullish coalescing for JavaScript” by Gabriel Isenberg. It proposes the ??
operator that replaces ||
when it comes to providing default values.
globalThis
The ECMAScript proposal “globalThis
” by Jordan Harband provides a new standard way of accessing the global object.
You may have read that JavaScript’s %
operator is a remainder operator, not a modulo operator. This blog post explains what that means.
.all()
, .race()
, .allSettled()
In this blog post, we take a look at three static methods of Promise
:
Promise.all()
and Promise.race()
which JavaScript has had since ECMAScript 6 when Promises were added to the language.Promise.allSettled()
which recently advanced to stage 4 and will therefore be part of ECMAScript 2020.