Category: factory functions

Quick Tip: What Are Factory Functions in JavaScript

You can’t get far as a JavaScript programmer without learning about functions and objects, and when used together, they are the building blocks we need to get started with a powerful object paradigm called composition. Today we’ll look at some idiomatic patterns for using factory functions to compose functi...

JavaScript Object Creation: Patterns and Best Practices

In this article, I’m going to take you on a tour of the various styles of JavaScript object creation, and how each builds on the others in incremental steps. JavaScript has a multitude of styles for creating objects, and newcomers and veterans alike can feel overwhelmed by the choices and unsure which they should use...