function sum(x){
    console.log('x:='+x);
     var y = function(x){ 
        console.log('xx:='+x);
        console.log('y:='+y);
          return sum(x+y) 
     }
     
     y.toString = y.valueOf = function(){ 
          return x; 
     } 
    console.log('yy:='+y);
     return y; 
} 
sum(1)(2)(3)(4);//10

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-23
  • 2022-02-13
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-29
  • 2022-02-01
  • 2022-02-25
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
相关资源
相似解决方案