get-depth

0.0.3 • Public • Published

get-depth

Get the Depth of a Multi-Dimensional Array

install

npm install get-depth

usage

const getDepth = require('get-depth');

const table = [
    [0, 1, 2, 3, 4, 5, 6, 7, 8 ], // first row
    [0, 1, 2, 3, 4, 5, 6, 7, 8 ] // second row
];

const depth = getDepth(table);
// depth is 2

Package Sidebar

Install

npm i get-depth

Weekly Downloads

2,790

Version

0.0.3

License

CC0-1.0

Unpacked Size

8.71 kB

Total Files

4

Last publish

Collaborators

  • danieljdufour