What is the advantage of using a Factory Function over direct object creation?
Factory functions provide encapsulation of object creation logic and ensure consistency across objects. They can include validation, default values, and complex initialization logic in one place, making the code more maintainable and reducing duplication. They also provide a level of abstraction, allowing you to change implementation details without affecting code that uses the factory.