RosettaCodeData/Task/Currying/JavaScript/currying-1.js

11 lines
149 B
JavaScript
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
function addN(n) {
var curry = function(x) {
return x + n;
};
return curry;
}
add2 = addN(2);
alert(add2);
alert(add2(7));