im sorry if this is a repost of an old topic, but i did search and coulnd't find a similar post.
this following piece of code an example of how im doing javascript inheritance in a project i am doing, now onfortunately, most of the end-users are on very low memory winXP+EI7 setups, so i am looking to save every bit of memmory that i can.
now my question is: do i actually save any memory by setting params = null in the end of the constructor, and should i do the same to the MyClass pointer after i have assigned the window.namespace.MyClass.MySubclass pointer to the same value?
(function (window, undefined) {
var MySubClass = function (params) {
this.elements = {
// jQuery dom elements
};
this.vars = {
// vars
};
this.controls = {
// class instances
};
this.init(params);
params = null; // cleanup
};
MySubClass.prototype = new namespace.MyClass.Base();
MySubClass.prototype.init = function (params) {
// do stuff
params = null; // cleanup
};
MySubClass.prototype.add = function (item) {
// adds item to an internal collection
};
window.namespace.MyClass.MySubClass = MySubClass;
})(window);