Hypera
Hypera is a simple to use module that allows you to create multi-dimensional arrays in an instant.
Installation
$ npm i hypera
Usage
Hypera module is imported into your project like this:
const Hypera = ;
You can also pass in an argument that will serve as the default value for all the elements of the array:
(If no argument is passed, the default value will be set to null
.)
const Hypera = false;
In this case, I'm setting the default value to false
.
After importing the module, you can use it like this:
// This will create a 2-dimensional array with 3 rows and 3 columns:let array = ; /* [ [ null, null, null ], [ null, null, null ], [ null, null, null ] ] */
Now you can create arrays with as many dimensions as you need.
For example, creating a 5-dimensional array where all the dimensions have a length of 3 would look like this:
let array = ;
License
MIT