Claude Pache (2014-12-29T13:01:27.000Z)
d at domenic.me (2015-01-05T21:30:42.546Z)
There is more than one way to resolve your problem. Here are those I see: (1) Use a getter: ```js class BaseView extends Backbone.View { get tagName() { return 'div' } } ``` (2) If the super constructor supports it, adjust the property after having called the super constructor: ```js class BaseView extends Backbone.View { constructor() { super() this.tagName = 'div' } } ``` (3) Otherwise, test if your property is already defined: ```js class BaseView extends Backbone.View { constructor() { if (this.tagName === undefined) this.tagName = 'div' super() } } ``` But it is not considered good style to send implicit parameters to the super-constructor through properties of the instance being constructed. You smell it when you see references to `this` before the call to `super()`. At this point, it may be preferable to refactor the code and make all parameters explicit: ```js class BaseView extends Backbone.View { constructor(params = {}) { if (params.tagName === undefined) params.tagName = 'div' super(params) } } ```