2015-10

Intercepting method calls via ES6 Proxies

[2015-10-07] esnext, dev, javascript, js proxies

This blog post explains how to use ES6 Proxies to intercept method calls to an object.

Read chapter “Meta programming with proxies” in “Exploring ES6” for more information on Proxies.

Enumerability in ECMAScript 6

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

Enumerability is an attribute of object properties. This blog post explains how it works in ECMAScript 6.

Let’s first explore what attributes are.

Concatenating Typed Arrays

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

Typed Arrays don’t have a method concat(), like Arrays do. The work-around is to use the method

typedArray.set(arrayOrTypedArray, offset=0)

ES6: methods versus callbacks

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

There is a subtle difference between an object with methods and an object with callbacks.

2015-09

Customizing ES6 via well-known symbols

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

In ECMAScript 6, the object Symbol has several properties that contain so-called well-known symbols (Symbol.iterator, Symbol.hasInstance, etc.). These let you customize how ES6 treats objects. This blog post explains the details.

__proto__ in ECMAScript 6

[2015-09-19] esnext, dev, javascript, __proto__

The property __proto__ (pronounced “dunder proto”) has existed for a while in most JavaScript engines. This blog post explains how it worked prior to ECMAScript 6 and what changes with ECMAScript 6.

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.