reduce-arguments

0.1.0 • Public • Published

reduce-arguments

npm version Build Status

Convert a function that takes two arguments into one that reduces all of its arguments.

Install

$ npm install --save reduce-arguments

Usage

var addTwo = (x,y) -> x+y
var add = reduceArguments(addTwo)
assert.equal(add(1,2,3,4,5), 15)

Complete source code

module.exports = (f)->
  (args...)->
    args.reduce f

License

ISC © Raine Lourie

Readme

Keywords

Package Sidebar

Install

npm i reduce-arguments

Weekly Downloads

2

Version

0.1.0

License

ISC

Last publish

Collaborators

  • raine