I'm looking to implement something like this:
var settings = (function () {
this.data = {
array1: [],
array2: [],
array3: []
};
this.hasSettings = function () {
//todo
};
})();
What I'd like to do with it is:
settings.data.array1.push(item);
Unfortunately i get an:
Uncaught TypeError: Cannot set property 'datas' of undefined
Could someone help me and explain the corrrect way to implement this?
Regards
new myFun(),. Instead you are calling it right away.