function partiallyAppliedFunction(firstNumber) {
return function(secondNumber) {
return firstNumber + secondNumber;
}
}
var addFiveTo = partiallyAppliedFunction(5);
var addTenTo = partiallyAppliedFunction(10);
print(addFiveTo(50)); // 55
print(addTenTo(100)); // 110
ZnVuY3Rpb24gcGFydGlhbGx5QXBwbGllZEZ1bmN0aW9uKGZpcnN0TnVtYmVyKSB7CglyZXR1cm4gZnVuY3Rpb24oc2Vjb25kTnVtYmVyKSB7CgkJcmV0dXJuIGZpcnN0TnVtYmVyICsgc2Vjb25kTnVtYmVyOwoJfQp9Cgp2YXIgYWRkRml2ZVRvID0gcGFydGlhbGx5QXBwbGllZEZ1bmN0aW9uKDUpOwp2YXIgYWRkVGVuVG8gPSBwYXJ0aWFsbHlBcHBsaWVkRnVuY3Rpb24oMTApOwoKcHJpbnQoYWRkRml2ZVRvKDUwKSk7IC8vIDU1CnByaW50KGFkZFRlblRvKDEwMCkpOyAvLyAxMTA=