code: function traverse(object, iterator, parent, parentProperty) {
          var key, child;
          if (iterator(object, parent, parentProperty) === false)
            return;
          for (key in object) {
            if (!object.hasOwnProperty(key))
              continue;
            if (key == 'location' || key == 'type')
              continue;
            child = object[key];
            if (typeof child == 'object' && child !== null)
              traverse(child, iterator, object, key);
          }
        }
docs: tree traversal, NB should use visitor pattern here