unordered-array-remove

WebJar for unordered-array-remove

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

unordered-array-remove
Last Version

Last Version

1.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

unordered-array-remove
WebJar for unordered-array-remove
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/mafintosh/unordered-array-remove

Download unordered-array-remove

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/unordered-array-remove/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>unordered-array-remove</artifactId>
    <version>1.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/unordered-array-remove/
implementation 'org.webjars.npm:unordered-array-remove:1.0.2'
// https://jarcasting.com/artifacts/org.webjars.npm/unordered-array-remove/
implementation ("org.webjars.npm:unordered-array-remove:1.0.2")
'org.webjars.npm:unordered-array-remove:jar:1.0.2'
<dependency org="org.webjars.npm" name="unordered-array-remove" rev="1.0.2">
  <artifact name="unordered-array-remove" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='unordered-array-remove', version='1.0.2')
)
libraryDependencies += "org.webjars.npm" % "unordered-array-remove" % "1.0.2"
[org.webjars.npm/unordered-array-remove "1.0.2"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

unordered-array-remove

Efficiently remove an element from an unordered array without doing a splice

npm install unordered-array-remove

build status

Usage

var remove = require('unordered-array-remove')

var list = ['a', 'b', 'c', 'd', 'e']
remove(list, 2) // remove 'c'
console.log(list) // returns ['a', 'b', 'e', 'd'] (no 'c')

This works by popping the last element (which is fast because it doesn't need shift all array elements) and overwriting the removed index with this element.

License

MIT

Versions

Version
1.0.2