2016-05

Handling whitespace in ES6 template literals

[2016-05-15] dev, javascript, esnext, template literals

In this blog post, we look at problems that arise when template literals contain whitespace:

  • Breaking up long lines
  • Dedenting content
  • Joining Arrays
  • Indenting inserted content

2016-04

Trees of Promises in ES6

[2016-04-17] dev, javascript, esnext, async, promises

This blog post shows how to handle trees of ES6 Promises, via an example where the contents of a directory are listed asynchronously.

Tracking unhandled rejected Promises

[2016-04-12] dev, javascript, esnext, async, promises

In Promise-based asynchronous code, rejections are used for error handling. One risk is that rejections may get lost, leading to silent failures. For example:

function main() {
    asyncFunc()
    .then(···)
    .then(() => console.log('Done!'));
}

If asyncFunc() rejects the Promise it returns then that rejection will never be handled anywhere.

Let’s look at how you can track unhandled rejections in browsers and in Node.js.

2016-03

Promise-based functions should not throw exceptions

[2016-03-25] dev, javascript, esnext, async, promises

This blog post gives tips for error handling in asynchronous, Promise-based functions.

The need for multi-platform npm packages

[2016-03-20] dev, javascript, esnext, npm, jsmodules

In this blog post, I argue that it should be possible to have multiple implementations of the same npm package (same name, same version).

2016-02

Arrow functions vs. bind()

[2016-02-24] dev, javascript, esnext, coding

ES6 arrow functions are often a compelling alternative to Function.prototype.bind().

Examples of name clashes in JavaScript’s standard library

[2016-02-22] dev, javascript, esnext

The main use case for ES6 symbols is that you can use them as property keys that can’t clash with other property keys.

In case you think that name clashes don’t matter, here are three examples of where name clashes caused problems in the evolution of the JavaScript standard library:

JavaScript fatigue fatigue

[2016-02-11] dev

Enough with the fatigue – tips against feeling overwhelmed:

ES proposal: Object.getOwnPropertyDescriptors()

[2016-02-04] dev, javascript, esnext, es proposal

The ECMAScript proposal “Object.getOwnPropertyDescriptors()” by Jordan Harband and Andrea Giammarchi is part of ECMAScript 2017. This blog post explains it.

ECMAScript 2017 (ES8): the final feature set

[2016-02-02] dev, javascript, esnext, es2017

Update 2017-01-29: At the TC39 meeting in January 2017, the last feature of ECMAScript 2017, “Shared memory and atomics” advanced to stage 4. That means that its feature set is now complete, as listed below.