1.2.0 • Published 9 years ago

mapcar v1.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

Mapcar License NPM version Dependency Status Build Status

Mapcar applies function fn to elements of lists with same index.

Each application result is put into resulting list.

Length of resulting list is the length of the shortest list argument.

Came from lisp.

Install

npm i mapcar --save
bower i mapcar --save

How to use?

mapcar(sum, [1,2,3,4], [1,2]);
// returns
[2,4]

function sum(array) {
    return array.reduce(function(value, item) {
        return value + item;
    }, 0);
}

License

MIT

1.2.0

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago