New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mutable-array

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mutable-array

Mutable array functions (mmap, mfilter)

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

mutable-array

Functions to modify an array in-place instead of making a copy.

example

var mmap = require('mutable-array').mmap;
var a = [1,2,3,4,5];

mmap(a, function (val) {
	return val + 1;
});

console.log(a);

//[2,3,4,5,6];

api

mmap([array,] callback, thisArg)

Standard Array.map functionality, but values that are returned from callback replace the original element in the array.

mfilter([array,] callback, thisArg)

Standard Array.filter functionality, but removes (using splice) values from the array if value returned from callback does not equal true.

applyPrototype()

Add all functions to the Array prototype.

license

MIT

Keywords

mutable

FAQs

Package last updated on 19 Nov 2015

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