nzakas / understandinges6

Content for the ebook "Understanding ECMAScript 6"
5.45k stars 796 forks source link

Potential typo in 09 - Classes #450

Closed ronen-e closed 3 years ago

ronen-e commented 4 years ago

in the section Class-Like Structures in ECMAScript 5 the following sentence is somewhat confusing:

In this code, PersonType is a constructor function that creates a single property called name.

Reason: The return value of PersonType is unclear. the constructor function returns an instance with a single property and returns it.

Solution:

In this code, PersonType is a constructor function that creates an instance with a single property called name.

The text above gives a clearer meaning for the return value of the PersonType constructor.

nzakas commented 4 years ago

Yup, definitely some missing words in there. Thanks for letting me know.