marray

1.1.6 • Public • Published

Marray

Very quick multi-arrays:

Marray.two(2,2) // => [
//   [undefined, undefined],
//   [undefined, undefined]
// ]
 
Marray.two(3, 3, () => []) // => [
//   [[], [], []],
//   [[], [], []],
//   [[], [], []]
// ]
 
Marray.two(3, 3, (x, y) => `${x}${y}`) // => [
//   ['0, 0', '0, 1', '0, 2'],
//   ['1, 0', '1, 1', '1, 2'],
//   ['2, 0', '2, 1', '2, 2']
// ]

The function for values gives back the x and y coordinates.

The entire point of this package is to make simple 2d arrays.

Package Sidebar

Install

npm i marray

Weekly Downloads

2

Version

1.1.6

License

MIT

Last publish

Collaborators

  • baweaver