Due to the fact that most pattern categories have been added to the collection, future roundups will only come when there is significant amount of updates.
Juriy “kangax” Zaytsev has put very detailed research findings about named function expressions. As it says on the github site: In a nutshell, named function expressions are useful for one thing only — descriptive function names in debuggers and profilers. It has been added to Function Declarations.
Classical Patterns (patterns that should generally be avoided)
- The Default Pattern – create an object using the Parent() constructor and assign this object to the Child()’s prototype
- Rent a Constructor – it borrows the parent constructor, passing the child object to be bound to this and also forwarding any arguments
- Rent and Set Prototype – restricts object creation for a class to only one instance
- Share the Prototype – restricts object creation for a class to only one instance
- A Temporary Constructor – first borrow the constructor and then also set the child’s prototype to point to a new instance of the constructor
- Klass – generally a pattern that should be avoided unless one is more comfortable with class than prototype
- Prototypal Inheritance – objects inherit from other objects
- Inheritance by Copying Properties – an object gets functionality from another object, simply by copying it
- Mix-ins – copy from any number of objects and mix them all into a new object
- Borrowing Methods – reuse one or two methods of an existing object without forming a parent-child relationship with that object