null-array
v1.0.0
Published
A module for creating a NullArray that only has index and length properties.
Downloads
1
Maintainers
Readme
NullArray
Create a null prototype Array. The created array will have no methods.
Table of Contents
Install
npm i null-array
Usage
import NullArray from 'null-array'
const nullArray = new NullArray()
nullArray.length // returns 0
nullArray.push // returns undefined
import NullArray from 'null-array'
const nullArray = new NullArray('a', 'b', 'c')
nullArray.length // returns 3
nullArray.push // returns undefined
nullArray[-1] // returns 'c'