In what all aspects, calling a function with and without new keyword differ in javascript? I mean what all things are differing between?
testFn() vs new testFn()
|
In what all aspects, calling a function with and without new keyword differ in javascript? I mean what all things are differing between?
|
||||
|
|
|
|
|||
|
These variants are syntactically different: with "new" variant supposes that the function is a constructor. The variant without "new" supposes, that it is not a constructor. |
|||
|
|