There are some typos and the fullName method doesn't exist in the User class
nickjeon opened this issue · 1 comments
nickjeon commented
There are some typos in
https://github.com/lydiahallie/javascript-react-patterns/blob/main/pages/patterns/design-patterns/factory-pattern.mdx
The fullName method is the same for all the objects that were created. By creating new instances, the fullName method is available on the prototype instead of on the objec, which saves memory.
It should be ... on the prototype instead of on the object...
.
In this section, the fullName
method doesn't exist in the User class. There is the getPosts
method instead.
https://javascriptpatterns.vercel.app/patterns/design-patterns/factory-pattern#tradeoffs