🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

jqb-array-remove

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

jqb-array-remove

remove an element from an array by value

0.0.1
latest
Source
npm
Version published
Weekly downloads
2
100%
Maintainers
1
Weekly downloads
 
Created
Source

jqb-array-remove

Remove an array item given it's value:

var arrayRemove = require('jqb-array-remove');
arrayRemove([1, 2, 3], 2);             // [1, 3]
arrayRemove(['a','b','c'], 'a', 'b');  // ['c']

You can pass as many values to remove from the original array, it returns filtered array.

arrayRemove.at(arr, idx)

Remove the given index:

var arrayRemoveAt = require('jqb-array-remove').at;
arrayRemove([1, 2, 3], 2);             // [1, 2]
arrayRemove(['a','b','c'], 0);         // ['b', 'c']

arrayRemove.deep()

Remove items by value, it deelply check items so it's good for removing objects by value.
(new method, not optimised)

var arrayDeepRemove = require('jqb-array-remove').deep;
arrayRemove.deep([{a:1},{b:2},{c:3}], {b:2}) // [{a:1},{c:3}]

Run Tests

If you want to run tests on this module you can prompt:

npm install && grunt

Keywords

array

FAQs

Package last updated on 20 Apr 2014

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