What would be a use case for this?
- Blake On Wed, Jul 13, 2016 at 7:42 PM, Bergi <[email protected]> wrote: > /#!/JoePea wrote: > > 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 >> ``` >> > > You can already do > > let dynamicNAme = "foo"; > let o = { > [dynamicName]: class { > … > } > }; > > but I can see absolutely no reason why you'd want to put a class inside an > object literal. > > Bergi > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

