docs: function clone(obj) {
      if (Array.isArray(obj)) {
          return obj.map(clone);
      } else if (typeof obj === 'object') {
          var copy = {};
          Object.keys(obj).forEach(function (key) {
              copy[key] = clone(obj[key]);
          });
          return copy;
      }
      return obj;
  }