[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 ES.next) where you previously had to do multiple
assignments. It’s especially nice for adding things to prototypes. For example:
function Person(name) {
this.name = name;
}
Person.prototype . {
describe() {
return "Person called "+this.name;
}
};
var Employee = Person <| function (name, title) {
super.constructor(name);
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
[email protected]
home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss