Wait... normally we lowercase almost all our declarations/LHS in javascript? Why are some functions uppercase?

Functions are uppercased to communicate to other developers the the new keyword is required. This also applies to JS classes, but remember in JS that classes are just syntatic sugar for constructor functions that operate in the same way.

This is called “the Constructor Invocation Pattern.” Here’s a little more about it in the MDN – New Operator. Also “Javascript: The Good Parts” has a really great writeup about it.  Invocation – JavaScript: The Good Parts [Book]

 

 

Leave a Reply