-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
In the language of your choice, write an example of:
add(1)(2) // A function that returns a function value.
each([1, 2, 3], print) // A function that takes a function parameter.
Add [language name].[language extension] source file to the root.
For example:
// javascript.js
function add(x) {
return function(y) { return x + y }
}
function each(list, callback) {
for (var i = 0; i < list.length; i++) { callback(list[i]) }
}
// Example usage
add(1)(2)
each([1, 2, 3], console.log)Please limit each pull request to one language, thank you.
Though multiple pull requests are welcome :)
Reactions are currently unavailable