
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600Γ Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600Γ faster than humans.
remove-item-array
Advanced tools
πͺremove array duplicates or customized with JS.
install:
yarn add remove-item-array
npm install remove-item-array --save
use:
const {
removeItems,
removeDuplicates
} = require('remove-item-array')
let arr = ['π', 'π', 'π','π«','π','π','π','π','π','π','π«']
// remove all
removeDuplicates(arr)
// or remove 'π'
removeDuplicates(arr, 'π')
// remove nums
removeItems(arr, 1, 4)
removeDuplicates(arr, item(?))
Removes item duplicates from an array.
arr
: {Array<*>} The target array.item
: {<*>} Removes item specified duplicate.removeItems(arr, start, count)
Performs better to splice, use Proxy can compare splice with removeItems.
arr
: {Array<*>} The target array.start
: {Number} start The index to begin removing.count
: The count of items need to remove.The function that removes all repeating elements, I code four methods, and made a comparison.
The array:
arr = [1, 1, 2, 5, 3, 1, 1, 2, 5, 3, 1, 1, 2, 5, 3, 1, 1, 2, 5, 3, 1, 1, 2, 5, 3, 1, 1, 2, 5, 3, 1, 1, 2, 5, 3]
You can view the results via the https://jsperf.com/removeduplicatesarray
The results:
By comparison, it can be seen that the performance of filter()
is better, so the function adopts the filter()
.
just run
yarn test
MIT.
FAQs
remove array duplicates or customized with JS
The npm package remove-item-array receives a total of 2 weekly downloads. As such, remove-item-array popularity was classified as not popular.
We found that remove-item-array demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.Β It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600Γ faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.