Which makes sense once you know that instance.constructor is accessing an altered constuctor property from the prototype, but otherwise might be quite confusing.
You're right that it probably doesn't belong with the other examples. Hopefully JavaScript developers unaware of prototype.constructor might find it interesting.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The confusing part is this:
Which makes sense once you know that
instance.constructor
is accessing an alteredconstuctor
property from the prototype, but otherwise might be quite confusing.You're right that it probably doesn't belong with the other examples. Hopefully JavaScript developers unaware of
prototype.constructor
might find it interesting.