In jQuery how to remove variables and functions

I have a function in jQuery for example.

var asd;

function dosomething(){
    for (i=0;i<=1000000;i++)
    {
    asd[i] = "(2^i)";
    }
}

How can I disable variables after a function?

delete $asd;

With this, I can clear the variable from memory.

But can I reach the function destructor in jQuery and how can I disable the whole function in the function destructor?

WHY

The function and all global variables are in memory after the script is run.
If I run something on the console, after the dom is ready - since all the variables are still in memory - the program will work.

So, I would like to clear the variables from the desctructor function, then reset the function or make it null.

script , . , , 100 800 . , .

+5
2

undefined:

asd = undefined;

, :

myFunction = undefined;

. misspelt undefined

+19

DOM. .remove([]).

, .

0

All Articles