In Depth - JavaScript Factory Functions

javascript

#1

JavaScript Factory Functions with ES6+
By Eric Elliott

A factory function is any function which is not a class or constructor that returns a (presumably new) object. In JavaScript, any function can return an object. When it does so without the new keyword, it’s a factory function.