【小记】--面试题(闭包/自执行函数)

 var test = function(a){
      this.a = a;
      return function(b){
        return this.a + b;
      }
    }(function(a,b){
      return a;
      }(1,2))
test(4)
解析
 var test = function(a){
      this.a = a;
      return function(b){
        return this.a + b;
      }
    }
    
    var getA = function(a,b){
      return a;
    }
    
    test(getA(1,2))(4);
原文地址:https://www.cnblogs.com/asenper/p/11642055.html