What is the main difference between factory functions and constructor functions?
The key difference is in how objects are returned: 1) Factory functions explicitly return objects using the return statement, 2) Constructor functions implicitly return 'this' when called with 'new', 3) Factory functions don't require the 'new' keyword, making usage more consistent, 4) Factory functions don't automatically set up prototype chains like constructors do, 5) Factory functions can return any type of object, including instances of classes, 6) Factory functions avoid potential issues caused by forgetting the 'new' keyword with constructors.