Class expressions in object initializers.

/#!/JoePea joe at trusktr.io
Thu Jul 14 02:32:42 UTC 2016


We can currently do

```js
let dynamicName = "foo"
let o = {
  [dynamicName]() { /* ... */ }
}
console.log(o.foo) // logs the function
​```​

Might be nice to be able to do it with classes too:

```js
let dynamicName = "foo"
let o = {
  class [dynamicName] { /* ... */ }
}
console.log(o.foo) // logs the class
​```​

*/#!/*JoePea
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160713/2928944d/attachment.html>


More information about the es-discuss mailing list