I want to have a bunch of objects, say:
function Block() {
this.canvas;
}
blocks = [];
And in some cases I will indicate:
block[x] = new Block();
and then:
block.canvas = document.createElement('canvas');
But I also want to delete this new canvas in order to free up memory sometimes. I just need to do:
block.canvas = null; (or whatever the appropriate method is)
And then javascript will free the memory at some point? Or is there an explicit way to delete an object and free up memory?
Thank!
source
share