B
blackholebutterfly
Why isn't this allowed?
function Foo(){
this.param1 = 'Constructor Function Foo';
}
var foo = new Foo;
var newfoo = new foo;
The last line above gives an error. I thought all objects could be
used as constructors. But it seems the foo object above cannot be used
with the 'new' operator to create more objects. Does anyone know why
that is?
Thanks.
function Foo(){
this.param1 = 'Constructor Function Foo';
}
var foo = new Foo;
var newfoo = new foo;
The last line above gives an error. I thought all objects could be
used as constructors. But it seems the foo object above cannot be used
with the 'new' operator to create more objects. Does anyone know why
that is?
Thanks.