Factory method is similar to the services. It is used to create new object and add functions as properties of this object and at the end we return this object.