daily pastebin goal
1%
SHARE
TWEET

Untitled

a guest May 16th, 2018 106 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function depth (d, tree) {
  2.   var ds = new Array();
  3.   for (var key in tree) {
  4.     switch (typeof tree[key]) {
  5.       case "object": ds.push(depth(d + 1, tree[key]));
  6.       default: break;
  7.     }
  8.   }
  9.   return ds.sort().last();
  10. }
RAW Paste Data
Top