I am wondering if it is possible for an object in javascript to delete itself once it has finished its task.
For example, I have the following object...
    var myObject = Object.create(baseObject);
    myObject.init = function() {
       /* do some stuff... */
       delete this;
    }
    myObject.init();
Does this work? If not, is there another way?
Thanks,