INNER CODE UNIT · JavaScript

traverseTree

SamuelTallet/MongoDB-PHP-GUI · source/js/jsonViewModified.js:237

  function traverseTree(node, callback) {
    callback(node);

    if (node.children.length > 0) {
      node.children.forEach(function (child) {
        traverseTree(child, callback);
      });
    }
  }

  function createNode() {
    var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    return {
      key: opt.key || null,
      parent: opt.parent || null,
      value: opt.hasOwnProperty('value') ? opt.value : null,
      isExpanded: opt.isExpanded || false,
      type: opt.type || null,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…