Objects are garbage collected once nothing else reference them. So to delete the Banana object just remove it from whatever variable or array or object that reference bananas:
var banana = new Banana();
banana = null; // the banana object will be deleted sooner or later
Looking at your code, the most obvious thing that gets referenced is the .move() method. It's probably referenced by a setTimeout() or setInterval() or requestAnimationFrame(). Just remove any reference to banana.move() in the animation loop and the object will get destroyed sooner or later.
Other things that may reference the object are DOM objects. But that's only if you do stuff like:
document.getElementById('banana_image').obj = banana;
Generally, most people will have links the other way round: the object will have references to DOM objects. That won't prevent the object from being garbage collected since the only requirement is that nothing else references the object.
Don't forget to destroy DOM objects that are no longer used (like the banana image) because they won't be garbage collected along with your object. The reason is there's still something referencing them: the browser window drawing them.
Self deletion
The only way to make self deletion work is to make the banana object aware of the thing referencing it. This is only possible for arrays and objects. Plain variables wont' work. It would have to be something like this:
function Banana(parent) {
this.parent = parent;
/* ... */
}
To self-unreference:
// if parent is array:
var i = this.parent.indexOf(this);
this.parent.splice(i,i);
// if parent is object:
delete this.parent[this.parent_key];
Although I've written something like the above before, I consider it an anti-pattern. A better solution is to have a property like this.alive and then implement your own high level garbage collector to delete the object from whatever thing that reference it when it's no longer "alive".
this.banana_imagefrom documentthis.pos_y > 500istrue?