scorbio: JavaScript Konstruktor in Literal Notation

Beitrag lesen

Hi du,
mhm du gibst auch nix zurück, weiß aber nicht ob es daran handelt genau.

Schau dir mal DOMAssistant an. Im Basisobjekt ist es etwa so:

  
var TEST = function() {  
    var myVar = null;  
    var myVar2 = null;  
    return {  
        allMethods : [],  
        publicMethods : [  
            "getMyVar",  
            "getMyVar2",  
            "setMyVar",  
            "setMyVar2"  
        ],  
  getMyVar: function(){  
   return this.myVar;  
  },  
  getMyVar2: function(){  
   return this.myVar2;  
  },  
  
  setMyVar: function(i){  
   this.myVar = i;  
  },  
  
  setMyVar2: function(i){  
   this.myVar2 = i;  
  }  
    };  
};