1 /** 2 * Created by chet on 15/12/17. 3 */ 4 var En= function (button,func) { 5 //dosth,不能return 6 alert(button+"kd"+func); 7 }; 8 En.aaa= function () { 9 alert(‘kkkk‘); 10 }; 11 En.prototype.outer= function () { 12 alert(‘我的alert‘); 13 }; 14 /*************************************************************************/ 15 var dd=new En(2,"jjjjjj"); 16 dd.outer(); 17 En.aaa(); 18 En("kkk","kkk"); 19 20 function abc(){ 21 //dosth 22 } 23 abc(); 24 /***********************************************************/ 26 var en= function (a) { 27 return{ 28 inner: function () { 29 alert(‘我是对象内部的函数‘+a); 30 } 31 } 32 }; 33 34 var dd=en(7); 35 dd.inner();
只发不解释……
原文:http://www.cnblogs.com/nidaye/p/5061226.html