fork download
  1. function partiallyAppliedFunction(firstNumber) {
  2. return function(secondNumber) {
  3. return firstNumber + secondNumber;
  4. }
  5. }
  6.  
  7. var addFiveTo = partiallyAppliedFunction(5);
  8. var addTenTo = partiallyAppliedFunction(10);
  9.  
  10. print(addFiveTo(50)); // 55
  11. print(addTenTo(100)); // 110
Success #stdin #stdout 0.01s 30384KB
stdin
Standard input is empty
stdout
55
110