I have a class that was created like this:
function T() {
this.run = function() {
if (typeof this.i === \'undefined\')
this.i = 0;
To delete an instance, in JavaScript, you remove all references pointing to it, so that the garbage collector can reclaim it.
This means you must know the variables holding those references.
If you just assigned it to the variable x, you may do
x = null;
or
x = undefined;
or
delete window.x;
but the last one, as precised by Ian, can only work if you defined x as an explicit property of window.