Skip to content

treeDepth

treeDepth(object) → number · Object

Get the maximum nesting depth of a tree structure.

  • object (required): nested object/array structure
utlx
treeDepth({a: {b: {c: 1}}})              // 3

Released under AGPL-3.0.