0

For example I have this function:

function Person(name, age){
this.name = name;
this.age = age;
this.planet = "Earth";

//and so on
}

And I can create new object:

var person = new Person("Natasha", 24);

and

var person = Person("Lisa", 32);

I know that 1st thing is right, but second is working too. Can you, please, tell me, why not to use thing without new?

Huangism
  • 16,278
  • 7
  • 48
  • 74

0 Answers0