Jesse McCarthy (2015-02-17T21:47:25.000Z)
d at domenic.me (2015-02-22T03:26:44.235Z)
Re: https://esdiscuss.org/topic/why-is-export-default-var-a-1-invalid-syntax I find myself wanting to do this kind of thing with a function returned from a function, e.g. when using Backbone, and it seems silly that I can't: ```js export default var Klass = Backbone.Model.extend(); Klass.prototype.whatever = whatever; // ... ``` For that use case will the following be functionally identical? Any gotchas with circular dependencies or anything? A) ```js var Klass = Backbone.Model.extend(); Klass.prototype.whatever = whatever; export default Klass; ``` B) ```js var Klass = Backbone.Model.extend(); Klass.prototype.whatever = whatever; export { Klass as default }; ``` C) ```js var Klass = Backbone.Model.extend(); export default Klass; Klass.prototype.whatever = whatever; ``` D) ```js var Klass = Backbone.Model.extend(); export { Klass as default }; Klass.prototype.whatever = whatever; ``` If I was willing to use class syntax could I do this? ```js export default class Klass extends Backbone.Model.extend(); Klass.prototype.whatever = whatever; ``` Glen Huang said: > I think this is illegal, should be {a: a} Sorry, I'm probably missing something obvious, but what is this referring to?