0

What's the difference between

var obj = new factoryCreation;

and

var obj = new factoryCreation();

in javascript.

Are these one and the same?? Assume factoryCreation is a function.

Alexander
  • 4,420
  • 7
  • 27
  • 42

1 Answers1

1

The MDN Web Docs says:

new Foo is equivalent to new Foo(), i.e. if no argument list is specified, Foo is called without arguments.

Alexander
  • 4,420
  • 7
  • 27
  • 42
Gerard van Helden
  • 1,601
  • 10
  • 13