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