In JavaScript, I was wondering if there is anything special about new
or if it is just syntactic sugar for call()
. If I have a constructor like:
function Person ( name, age ){
this.name = name;
this.age = age;
}
is
var bob = new Person( "Bob", 55 );
any different than
var bob;
Person.call( bob = new Object(), "Bob", 55 );
?