I don't think
delete
does what you think it does in JavaScript. According to
Mozilla[
^]:
Quote:
Unlike what common beliefs suggests, the delete operator has nothing to do with directly freeing memory
and
Quote:
delete is only effective on an object's properties. It has no effect on variable or function names.
Since you're using it on local variables, it should do nothing. Additionally, even if it did work that way, you would want to call it
before setting a value to
null
, otherwise you are just deleting
null
, not the information that was there before.