Callable Objects in JavaScript

from blog The Darth Mall, | ↗ original
Recently, Chris Fedinandi wrote about the constructor pattern and when you might use it. This got me thinking about a design pattern in JavaScript of which I’m fond—I think of the pattern as “callable objects”. I first encountered this pattern in D3, where it is used extensively to create utilities like scales. I probably call these “callable...