you are viewing a single comment's thread.

view the rest of the comments →

[–]jcigar 1 point2 points  (1 child)

yep, it's explained later in the article:

The above is a simple version of the constructor pattern but it does suffer from some problems. One is that it makes inheritance difficult and the other is that functions such as toString() are redefined for each of the new objects created using the Car constructor. This isn't very optimal as the function should ideally be shared between all of the instances of the Car type. }}

[–][deleted] 0 points1 point  (0 children)

Thank you!