Difference between a new object with or without parentheses

Possible duplicate:
new MyClass (); vs new MyClass;

Please see comments below.

When creating a new instance of the object, what is the difference between A and B below

A using brackets

var foo = new Bar(); 

B without brackets

 var foo = new Bar; 

I use backbone.js where many examples do not use parentheses. Also, what is the correct terminology for calling () ? Run?

+6
source share

Source: https://habr.com/ru/post/892856/


All Articles