On Tue, Jun 12, 2018 at 12:31 PM, Aadit M Shah <[email protected]> wrote: > Classes in JavaScript don't allow assignments within the class body. Hence, > the following code is invalid: > > class Test { > x = 123; // This throws an error. > lazy random = this.x + Math.random(); // Similarly, this should be > invalid. > }
Andrea was using syntax from the [class fields proposal][1], currently at Stage 3 and fairly commonly used via transpilation (he said "class fields" later in the post, but didn't emphasize it). -- T.J. Crowder [1]: https://github.com/tc39/proposal-class-fields
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

