1 | # array-map
|
2 |
|
3 | `[].map(f)` for older browsers
|
4 |
|
5 | [![testling badge](https://ci.testling.com/substack/array-map.png)](https://ci.testling.com/substack/array-map)
|
6 |
|
7 | [![build status](https://secure.travis-ci.org/substack/array-map.png)](http://travis-ci.org/substack/array-map)
|
8 |
|
9 | # example
|
10 |
|
11 | ``` js
|
12 | var map = require('array-map');
|
13 | var letters = map([97,98,99], function (c) {
|
14 | return String.fromCharCode(c);
|
15 | });
|
16 | console.log(letters.join(''));
|
17 | ```
|
18 |
|
19 | output:
|
20 |
|
21 | ```
|
22 | abc
|
23 | ```
|
24 |
|
25 | # methods
|
26 |
|
27 | ``` js
|
28 | var map = require('array-map')
|
29 | ```
|
30 |
|
31 | ## var ys = map(xs, f)
|
32 |
|
33 | Create a new array `ys` by applying `f(xs[i], i, xs)` to each element in `xs` at
|
34 | index `i`.
|
35 |
|
36 | # install
|
37 |
|
38 | With [npm](https://npmjs.org) do:
|
39 |
|
40 | ```
|
41 | npm install array-map
|
42 | ```
|
43 |
|
44 | # license
|
45 |
|
46 | MIT
|