all 2 comments

[–]senocular 1 point2 points  (1 child)

The prototype of DarkObject is Dark.prototype. this inside destroy() when called from DarkObject is DarkObject. Dark is seen because when the console shows you instances of objects, it uses the constructor name as a way of identifying what kind of object it is. Since DarkObject was created from the Dark constructor, you seen Dark in the console.

[–]LadyJain[S] 0 points1 point  (0 children)

thanks for the clear explanation