var foo= function(){
this.a=1;
}
var obj= new foo;
console.log(obj);
how can object be created using foo
instead of foo()
?
will the constructor will be called if i don't use parentheses ?
i think foo is also function in order to call the inside code we need parentheses but here why it doesn't need ?