A constructor function is a way to create a function that will constructor a type of object that contains methods and properties that are not unique properties and methods of the object itself, but are contained in the prototype object of it. If you have logged any about of time at all playing around with javaScipt chances are you might have all ready used the new keyword with a built in constructor such as the Date constructor for example.
To use the new operator just type new and then the constructor function that there needs to be an instance of. If no parentheses are used then default values will be used for any arguments, otherwise use parentheses to give one or more arguments to the constructor function.
So Say I want to use the new keyword to create a new instance of Date, I can do so like this.
In this example the d variable is an instance of Date that was created using the new operator with the Date constructor function. Once I have my instance of Date I can use any of the prototype methods of the Date constructor such as Date.getDate. In addition to methods that are part of the Date constructor I can also make use of any additional prototype methods that may be in the prototype chain including the hasOneProperty methods that is part of the base Object prototype.
To create my own constructor function I just need to create a function and in the body of the constructor function or any prototype method I just use the this keyword as a way to refer to any property that is to be an OwnProperty of an instance of this constructor when created using the new operator.
If I where to to call this method without using the new operator the method would return the undefined value which is the default value that is return when a function is called in that manner without the use of the new keyword.
When using the new keyword with no arguments passed to the constructor this will still result in a new instance of the constructor. As one might expect the instance of the constructor will have default values for all of its arguments.