If you have a class like this:
function Test(propVal){ this.prop = propVal; }
You will get the following results:
Calling Test () This will return "undefined" since Test works as a constructor
Calling a new test (5) You will receive a new instance of Test, and this instance will have its "prop" equal to 5
Calling a new test You will receive a new instance of Test, and this instance will have its "prop" set to undefined
Hope this helps.
Thanks,
source share