Hi Isiah,

My understanding is that this should log "true". Class constructors may
return any object they wish, and needn't return instances of the class.

Hopefully, this will allow you to simplify.

Thanks,

Eric

On Fri, Oct 16, 2015 at 2:02 PM, Isiah Meadows <[email protected]>
wrote:

> What should `this` be in class `B`? The value of `object` or an instance
> of `B`? It's an edge case, but could simplify my code a little if it's the
> former.
>
> ```js
> const object = {}
>
> class A {
>   constructor() {
>     return object
>   }
> }
>
> class B extends A {
>   constructor() {
>     super()
>     console.log(this === object)
>   }
> }
> ```
>
> _______________________________________________
> 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

Reply via email to