array-limits
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

array-limits

NPM Version Downloads Stats

Just another way of telling that everything is possible.

Usage

Setting limit

const arr = [0, 0, 0, 0];  
  
arr.limit(4);  // if not set, defaults to 1000000
  
arr.push(0); // should throw an error since 4 is the limit of the array

Checking array's free space

const arr = [0, 0, 0];

console.log(arr.availableSpace()); // should return the available space of an array

checking if array is full

const arr = [0, 0, 0, 0];

console.log(arr.isFull()); // should return a boolean that tells if array is full or not

Note

  • This is not intended for something serious, the only reason of it's existence is to prove a point. Yes, everything is possible.

Package Sidebar

Install

npm i array-limits

Weekly Downloads

0

Version

1.3.0

License

MIT

Unpacked Size

7.08 kB

Total Files

6

Last publish

Collaborators

  • yakovmeister