Using monocle mustache for chaining.

Axel Rauschmayer axel at
Sat Nov 12 12:22:32 PST 2011

[Apologies for interrupting...]

> If we do classes, what .{ use-cases remain?

The operator allows you to use object literals (including all of the niceties that will be introduced in where you previously had to do multiple assignments. It’s especially nice for adding things to prototypes. For example:

    function Person(name) { = name;
    Person.prototype . {
        describe() {
            return "Person called ";
    var Employee = Person <| function (name, title) {
        this.title = title;
    Employee.prototype . {
        describe() {
            return super.describe() + " (" + this.title + ")";

The power of object literals will grow and the monocle operator allows us to use this power in many more places.

If find that the above pretty enough that I could make do without class declarations.

Dr. Axel Rauschmayer
axel at


More information about the es-discuss mailing list