# @ndhoule/map

> Apply a function to a each element of a collection and return a new array of results.

Latest version **2.0.1** (published 2016-05-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ndhoule/map
pnpm add @ndhoule/map
yarn add @ndhoule/map
bun add @ndhoule/map
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2016-05-02 |
| First published | 2015-05-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Nathan Houle |
| Maintainers | ndhoule |
| Keywords | component |

## Links

- npm: https://www.npmjs.com/package/@ndhoule/map
- Repository: https://github.com/ndhoule/map
- Issues: https://github.com/ndhoule/map/issues
- npm.io page: https://npm.io/package/@ndhoule/map

## Dependencies (1)

- [@ndhoule/each](https://npm.io/package/@ndhoule/each.md) ^2.0.1

## Recent versions

- 2.0.1 (latest) — 2016-05-02
- 2.0.0 — 2016-05-02
- 1.0.2 — 2015-05-05
- 1.0.1 — 2015-05-04

## README

# map [![CI][ci-badge]][ci-link]

Apply a function to a each element of a collection and return a new array of results.

## Installation

```sh
$ component install ndhoule/map
$ npm install @ndhoule/map
```

## API

### map(iterator : Function, collection : Object|Array|string) => Array

Produce a new array by passing each value in the input `collection` through an `iterator` function and accumulating the results. The `iterator` is passed three arguments: `(value, index, collection)`.

```javascript
var square = function(x) { return x * x; };

map(square, [1, 2, 3]);
//=> [1, 4, 9]
```

## License

Released under the [MIT license](LICENSE.md).

[ci-link]: https://travis-ci.org/ndhoule/map
[ci-badge]: https://travis-ci.org/ndhoule/map.svg?branch=master

---
_Source: https://npm.io/package/@ndhoule/map · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
