Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
//function add(x) {________}; alert(add(2)(3)(4));
function add(x){
  var res=0;
  return (function tt(x){
    res = x+res;
    arguments.callee.toString = function(){
      
      return res;
    };
    return arguments.callee;
  })(x);
}
alert(add(2)(3)(4));
function add(x){
  return function(y){
    return function(z){
      return x+y+z;
    }
  }
}
function add(x){
  if(add.i){
    add.i += x;
  }else{
    add.i=x;
  }
  add.toString = function(){
    return add.i;
  }
  return add;
}
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers