New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Maintainers
1
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc