array-map-x

3.1.2 • Public • Published

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

array-map-x

Creates an array with the results of calling a function on every element.

module.exportsarray

This method creates a new array with the results of calling a provided function on every element in the calling array.

Kind: Exported member
Returns: array - A new array with each element being the result of the callback function.
Throws:

  • TypeError If array is null or undefined.
  • TypeError If callBack is not a function.
Param Type Description
array array The array to iterate over.
callBack function Function that produces an element of the Array.
[thisArg] * Value to use as this when executing callback.

Example

import map from 'array-map-x';
 
const numbers = [1, 4, 9];
console.log(map(numbers, Math.sqrt));// [1, 2, 3]
console.log(numbers)); // [1, 4, 9]

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
3.1.23latest

Version History

VersionDownloads (Last 7 Days)Published
3.1.23
3.1.10
3.1.00
3.0.220
3.0.210
3.0.200
3.0.190
3.0.180
3.0.170
3.0.160
3.0.150
3.0.140
3.0.130
3.0.120
3.0.110
3.0.100
3.0.90
3.0.80
3.0.70
3.0.60
3.0.50
3.0.40
3.0.30
3.0.20
3.0.10
3.0.00
2.3.0187
2.2.00
2.1.00
2.0.00
1.3.00
1.2.00
1.1.00
1.0.10
1.0.00

Package Sidebar

Install

npm i array-map-x

Weekly Downloads

190

Version

3.1.2

License

MIT

Unpacked Size

300 kB

Total Files

11

Last publish

Collaborators

  • xotic750