Factory Function
When a function returns an object, we call it a factory function. It can produce object instance without new keywords or classes.
Ex:-
Factory Function with Parameter
Ex:-
Latest posts by rajeshkumar (see all)
When a function returns an object, we call it a factory function. It can produce object instance without new keywords or classes.