In one of my questions, I got the following code as one of the answers. My understanding of the language has come has come a far better now, just have one small question.
There are a few ways to define Javascript classes and invoke them with a constructor. But remember that JavaScript is actually classless.
An excellent article about it can be found here: 3 ways to define a Javascript class