2015-09

ECMAScript 6: holes in Arrays

[2015-09-13] esnext, dev, javascript

This blog post describes how ECMAScript 6 handles holes in Arrays.

The names of functions in ES6

[2015-09-10] esnext, dev, javascript

Update 2015-12-26: Sections for two caveats: “the name of a function is always assigned at creation” and “minification

The name property of a function contains its name:

> function foo() {}
> foo.name
'foo'

This property is useful for debugging (its value shows up in stack traces) and some metaprogramming tasks (picking a function by name etc.).

Prior to ECMAScript 6 (ES6), this property was already supported by most engines. With ES6, it becomes part of the language standard and is frequently filled in automatically.

Typed Arrays in ECMAScript 6

[2015-09-05] esnext, dev, javascript

Typed Arrays are an ECMAScript 6 API for handling binary data. This blog post explains how they work.

2015-08

What happened to Web Components?

[2015-08-29] dev, webcomponents, clientjs

Three years ago, there was a lot of excitement surrounding Web Components: everybody talked about them, the frameworks Ember and Angular planned to integrate them or even be based on them, etc.

By now, that excitement seems to have died down. This blog post examines what happened to Web Components. Spoiler: they are alive and well and slowly being adopted across browsers.

Logging variables via an ES6 tagged template

[2015-08-27] esnext, dev, javascript, template literals

This blog post shows how you can use a tagged template to log variables more efficiently.

In order to understand it, you should be familiar with ECMAScript 6 template literals and tagged templates. For an introduction, consult chapter “Template literals and tagged templates” of “Exploring ES6”.

Is “Isomorphic JavaScript” a good term?

[2015-08-24] dev, javascript

A recent trend in the web development world is to use JavaScript on the server to assemble pages there, with the same code that is used to manage them in the client. That lets you initially see content faster, especially on mobile devices and helps with search engines.

How are we supposed to call code that runs on either server or client? Michael Jackson doesn’t like a recent proposal:

Five little-known facts about ES5 object literals

[2015-08-20] dev, javascript, jslang

This blog post describes five little known facts about ECMAScript 5 (ES5) object literals:

  1. ECMAScript 5 has getters and setters
  2. Trailing commas are legal
  3. You often don’t have to quote property keys
  4. You can use reserved words as unquoted property keys
  5. Using objects as dictionaries is surprisingly tricky

Converting ES6 Maps to and from JSON

[2015-08-17] esnext, dev, javascript

When you have key-value data whose keys you don’t know in advance, it’s generally better to store it in an ES6 Map than in an object. But how do you convert Maps to and from JSON? This blog post tells you.

Getting started with ECMAScript 6

[2015-08-06] esnext, dev, javascript

This blog post helps you to get started with ECMAScript 6 (ES6):

  • It explains how you can interactively try out ES6.
  • It lists ES6 features that are easy to adopt, along with how those features are coded in ES5.

2015-07

New regular expression features in ECMAScript 6

[2015-07-29] esnext, dev, javascript

This blog post explains new regular expression features in ECMAScript 6. It helps if you are familiar with ES5 regular expression features and Unicode. Consult the following two chapters of “Speaking JavaScript” if you aren’t: