JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 86715
  • Score
    100M100P100Q173663F
  • License MIT

remove items from a javascript array without generating memory garbage

Package Exports

  • remove-array-items

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (remove-array-items) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

remove-array-items

remove items from a javascript array without generating memory garbage.

Build Status

Despite there being a number of "remove array items" in npm, I couldn't find satisfying all criteria:

  • doesn't generate garbage
  • performs similar or better to the native array.splice
  • es3+ compatible
  • has tests

so here we are.

originally inspired by https://gamealchemist.wordpress.com/2013/05/01/lets-get-those-javascript-arrays-to-work-fast/

(which is a gold mine for performant, non-garbage generating array operations by the way.)

usage

const removeItems = require('remove-array-items')

const arr = [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]

removeItems(arr, 3, 4)  //  after execution, arr === [ 1, 2, 3, 8, 9 ]