Factory functions
Factory function introduction
The factory function pattern is similar to constructors, but instead of using new
to create an object, factory functions simply set up and return the new object when you call the function. Check out this example:
Last updated