0

Is there any difference between the following two?

var a=new Object() and var a=Object()

After executing each of them on the console, a is an empty object.

  • See also: http://stackoverflow.com/questions/1646698/what-is-the-new-keyword-in-javascript – ceejayoz Jan 17 '17 at 18:08
  • If you're asking about `Object` specifically, then my duplicate answers your question (the answer is "none, unless you look very closely in some potential case that may or may not actually exist"). If you're asking generally about what `new` does, versus a bare function call, the link above will answer that. – apsillers Jan 17 '17 at 18:10

0 Answers0