Skip to content

unclouded/map

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

map

Map an object or array.

Installation

$ component install ianstormtaylor/map
$ npm install ianstormtaylor/map

Example

Arrays:

var map = require('map');

map([1, 2, 3], function (val, i) {
  return 10 + val;
});

// [11, 12, 13]

Objects:

var map = require('map');

map({ a: 1, b: 2, c: 3 }, function (key, val) {
  return 10 + val;
});

// [11, 12, 13]

API

map(obj, iterator)

Map the obj using an iterator.

License

MIT

Packages

No packages published

Languages

  • JavaScript 96.9%
  • CSS 3.1%