How would you know when to use factory functions?

2 posts were split to a new topic: What is the difference between Factory Functions and Classes?