> Design Patterns > Factory Method > Factory Method Design Pattern In JavaScript

Factory Method Design Pattern In JavaScript

Factory Method design pattern in JavaScript using subclass to create object of a derived class of another class which is not known.


Factory Method design pattern In JavaScript / js

Output

Creator::AnOperation()
ConcreteCreator::FactoryMethod()
ConcreteProduct:UseProduct()


Suresh Kumar Srivastava is founder of online learning site coursegalaxy.com and author of popular books C In Depth, Data Structures Through C In Depth. He has 18+ years experience in industry and worked on architecture and design of multiple products. This article Factory Method Design Pattern In JavaScript is from his Design Patterns course.