Skip to content

Add other languages #1

@mtso

Description

@mtso

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 :)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions