A
Andrew Poulos
Why is it that if I do this:
Foo = function() {
this.prop = true;
};
Foo.prototype.hi = function() {
alert("hi");
};
bar = new Foo();
delete bar;
bar.hi();
nothing gets alerted. But if I change the call to the constructor to
var bar = new Foo();
then the alert gets fired. And if I do this:
Foo = function() {
this.prop = true;
};
Foo.prototype.hi = function() {
delete this;
};
bar = new Foo();
bar.hi();
the object 'bar' does not seem to have been deleted? I'm testing with FF 2.
Andrew Poulos
Foo = function() {
this.prop = true;
};
Foo.prototype.hi = function() {
alert("hi");
};
bar = new Foo();
delete bar;
bar.hi();
nothing gets alerted. But if I change the call to the constructor to
var bar = new Foo();
then the alert gets fired. And if I do this:
Foo = function() {
this.prop = true;
};
Foo.prototype.hi = function() {
delete this;
};
bar = new Foo();
bar.hi();
the object 'bar' does not seem to have been deleted? I'm testing with FF 2.
Andrew Poulos