You need add to be a function that takes an argument and returns a function that takes an argument that adds the argument to add and itself.
var add = function(x) {
return function(y) { return x + y; };
}
More Related Contents:
- What is ‘Currying’?
- Variadic curried sum function
- JavaScript curry: what are the practical applications?
- How to correctly curry a function in JavaScript?
- How to curry a function across an unknown number of parameters
- javascript function doesn’t work when link is clicked
- Pass variables by reference in JavaScript
- How can I group data with an Angular filter?
- Is it wrong to place the tag after the tag?
- JavaScript/JQuery: $(window).resize how to fire AFTER the resize is completed?
- Parse DateTime string in JavaScript
- Count number of matches of a regex in Javascript
- canvas.toDataURL() SecurityError
- Google Map API v3 — set bounds and center
- How can I disable a browser or element scrollbar, but still allow scrolling with wheel or arrow keys?
- Where would I use a bitwise operator in JavaScript?
- Common sources of unterminated string literal [duplicate]
- JavaScript data formatting/pretty printer
- “Meteor code must always run within a Fiber” when calling Collection.insert on server
- setInterval() behaviour with 0 milliseconds in JavaScript
- What’s the most elegant way to cap a number to a segment?
- JavaScript window.location does not set referer in the request header
- Is there any way to accelerate the mousemove event?
- Search a JavaScript object
- Using JavaScript what’s the quickest way to recursively remove properties and values from an object?
- Solving TicTacToe with minimax algorithm in Javascript
- JavaScript Regex to match a URL in a field of text
- Angular 2 AuthGuard Service with redirect?
- How to get MIME-TYPE from Base 64 String?
- Javascript: PI (π) Calculator