Performant JavaScript

If you need to share functionality across instances of a class, it is massively more performant to share functionality via prototypes.

This was a huge takeaway from yesterday’s lecture by @sgharms at Dev Bootcamp on inefficient versus efficient method sharing in JavaScript.

Using JS prototype functions to share functionality amongst instances of a class is significantly more performant and uses less memory than encapsulating shared methods in the constructor function.

Who knew.

 
2
Kudos
 
2
Kudos

Now read this

I am the 2%

It is often difficult to express the feelings of discouragement, detachment, isolation, and self-doubt that come with being the anomaly of the tech industry. After a career of 4+ years at giant Silicon Valley tech companies, where racial... Continue →