hypera

1.0.1 • Public • Published

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 = require('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 = require('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 = Hypera(3,3);
 
/* [ [ 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 = Hypera(3,3,3,3,3);

License

MIT

Package Sidebar

Install

npm i hypera

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

3.42 kB

Total Files

4

Last publish

Collaborators

  • fry98