i'm looking for a way to force all of my objects have it's own instance of object in prototype. This object in prototype has it's own private variables. I don't want to share this objects. What should i do?
new function () {
"use strict";
function Controls() { };
Controls.prototype = new Application.Utils.Map(); //instance of this object is shared between all of new Controls objects. I want have new Map object for each new Controls Object.
Application.Stored.UI.Controls = new Controls();
Application.Stored.UI.Controls2 = new Controls();
}();
Map object looks like this:
function(){
//private variables with methods
return {
func: someFunc,
...
};
};
How to achieve this?