🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

map-plus

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

map-plus

Creates a new array of values by mapping each value in list through an iteratee.

Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
25
Maintainers
1
Weekly downloads
 
Created
Source

map-plus Build Status

Produces a new array of values by mapping each value in list through a transformation function (iteratee).

The iteratee is passed three arguments: the value, then the index (or key) of the iteration, and finally a reference to the entire list.

Inspired by _.map. 😄

Install

Install with npm

$ npm install map-plus

Or unpkg

<script src="https://unpkg.com/map-plus@1.0.2/umd/index.js" />

Check out the unit tests on CodePen.

Usage

const map = require('map-plus');

map([1, 2, 3], num => num * 3);
//=> [3, 6, 9]

map({one: 1, two: 2, three: 3}, (num, key) => num * 3);
//=> [3, 6, 9]
Like us a lot? Help others know why you like us! Review this package on pkgreview.devReview us on pkgreview.dev

API

map(list, iteratee, [context])

list

Type: array or object
Default: none

The collection of elements to iterate over.

iteratee

Type: function or string
Default: none

Function to apply. Or property name to pass.

License

MIT

Keywords

array

FAQs

Package last updated on 29 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts