I started picking up JavaScript again months ago. I created a repo for some notes that I created while learning Design Patterns in the context of J...
For further actions, you may consider blocking this person and/or reporting abuse
Had a quick look at the "Creational Design Patterns".
You put these three together:
Which would naturally mislead the readers to think they are equivalent. You should note that
Object.create(null)
do not inherit theObject.prototype
.There is also an error in the code example:
Hi, thanks for the feedback! I've corrected said code snippet. Thanks for pointing that out.
As for your first concern. They indeed have some differences but I figured to just write something about it as a different topic. I should've gone first with that but my intention was first and foremost, to learn design patterns for myself. Right now, I'm just addressing JavaScript caveats that has something to do with design patterns context within JavaScript. Like defining a function within the function constructor versus via the prototype.
Which book are you referring to? It would be great to have practical examples of different design patterns it greatly helps visualise the requirement and usage of these patterns. Best wishes!
Hi, I forgot to link the actual book I'm using, I've updated the post now. Thanks for your feedback. It's Learning JavaScript Design Patterns by Addy Osmani like Thomas said.
I'll try to make practical examples like that as much as possible especially on those patterns that really needs extra attention.
addyosmani.com/resources/essential...... just a wild guess 😉
Yes you're right, thanks! I forgot to add it on the post I was so sleepy the night I posted this. 😉