array-control

method extensions of Array.prototype

Usage no npm install needed!

<script type="module">
  import arrayControl from 'https://cdn.skypack.dev/array-control';
</script>

README

Array-Control

array-control will extend Array.prototype with these useful functions


Array::copy()

Array::hasObject(object)
Array::hasAnyOfObjects(object)
Array::hasAllOfObjects(object)

Array::addObject(object)
Array::addObjects(objects)
Array::insertObjectAtIndex(object,index)

Array::removeObject(object) // removes ALL occurencies of object
Array::removeObjects(objects) // removes ALL occurencies of objects

Array::removeFirstObject(object)
Array::removeLastObject(object)