What is the difference between calling a constructor function with and without the `new` operator?
19:24 25 Apr 2012

Is there a difference between calling a JavaScript function with or without the new keyword? For instance if I had a function:

function computer(){
  this.hardDrive = "big";
  this.processor = "fast";
}

and I then call it in two different ways:

var hp = computer();
var hp = new computer();

what is going to be the difference between the two function calls?

javascript object new-operator