I found this laying around in an old note app I haven't opened in a while. Whenever I learn something new, I like to write it down and explain it to myself in the most basic and non-allegorical method possible. Turns out that these explanations make for great unpublished blog posts. Constructors are probably one of the most mysterious features of Javascript and I wish someone would have explained it to me like this when I first learnt it.
The prototype
property of a constructor has always confused me. I've never really been certain to what it actually did. I just knew that it was a simple way of adding properties and methods to a class-like object that I could instantiate. This week, I decided to delve into the problem to figure out what is actually going on here.
Turns out the new
construct is just a distraction added by some programmers who thought Javascript needed to appeal to the Java community. Sounds like a good idea during 1995. However, the introduction of this language construct put Javascript