There are many ways to declare functions in Javascript. Sometimes, the way we choose to declare them might just be a matter of preference, but it’s good nevertheless to know some of the hidden costs that can occur when using certain constructs.
Here, we’re going to take a look at two different methods and compare their efficiencies. Before we jump into these different methods, here’s a quick refresher for those of you who aren’t too sure of the difference between classes and instances.
