sparse-array
Sparse array implementation in JS with no dependencies
Install
$ npm install sparse-array --save
Use
Create:
const SparseArray = const arr =
Set, get and unset:
const index = 0arr arr // 'value' arr arr // undefined
Iterate:
arr const mapped = arr const result = arr
Find:
const firstEven = arr
Internal representation:
Bit field:
const bitField = arr
Compact array:
const compacted = arr
License
ISC