Siri: Frage zur Notation non JavaScripten

Beitrag lesen

var example1 = (function () {

function test1() {
this.test1a = function() {
return "a";
}

  this.test1b = function() {  
  		return "b";  
  }  

}

return {
anfrage1: function() {
myTest = new test1();
return myTest.test1a() + myTest.test1b();
}
}

})();

  
Hier fehlt noch  
`alert("1:" + example1.anfrage1())`{:.language-javascript}  
als Aufruf.  
  

> ~~~javascript

var exapmle2 = {};  

> exapmle2.test2 = function() {  
>   
> 	function test2a() {  
> 		return  "a";  
> 	};  
> 	  
> 	function test2b() {  
> 			return "b";  
> 	};	  
> 	  
> 	return {  
> 		anfrage2: function() {  
> 			return test2a() + test2b();  
> 		}  
> 	};  
> }();  
> alert("2:" + exapmle2.test2.anfrage2());