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