JavaScript Factory Functions with ES6+

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.

Read More