This is a question which is related to memory usage and "new" keyword. I need your suggesions and preferences for using "new" in local methods. 

```
get: function ()
{
    **var get = new Ajax.Updater**('resourceList',
    "url",
    {
        method: 'POST',
        onComplete: this._onComplete.bind(this)
    });
}
```

In the above code, I am assigning the object to a local variable which is not used anywhere, I can write the code in the following way also

```
get: function ()
{
    **new Ajax.Updater**('resourceList',
    "url",
    {
        method: 'POST',
        onComplete: this._onComplete.bind(this)
    });
}
```

Here I am not assigning the object to any variable.

I am little confused now. Which way is better, assigning to a variable or not assigning to a variable? If I assign to a variable after the local method scope the object will be taken off from memory, but if I don't assign what will happen? Will it be taken care of by garbage collection? What is Which is the best way of doing it ? Personally I prefer to assign to a variable; is that correct? when will the object get destroyed if I am not assigning to a variable?