Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/component/map
Map utility
https://github.com/component/map
Last synced: 13 days ago
JSON representation
Map utility
- Host: GitHub
- URL: https://github.com/component/map
- Owner: component
- Created: 2012-09-19T18:07:43.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-10-09T23:41:50.000Z (about 11 years ago)
- Last Synced: 2024-05-08T17:10:58.740Z (8 months ago)
- Language: JavaScript
- Size: 119 KB
- Stars: 5
- Watchers: 5
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# map
Map utility
## Installation
$ component install component/map
## API
### map(array, fn)
Map returning a new array:
```js
var names = map(users, function(user){
return user.name;
});
```### map(array, string)
Map properties in `string` returning a new array:
```js
var names = map(users, 'user.name');
var firstNames = map(users, 'user.name.first');
```# License
MIT