Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
es7 `new` fix
class Point2D {
.constructor(x, y) { this.x = x, this.y = y; }
.[](x, y) { return new this.constructor(x, y); }

This comment has been minimized.

Copy link
Owner Author

@ericelliott ericelliott commented Mar 6, 2015

Example by Brendan Eich.

See How to Fix the ES6 class Keyword for context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment