code: function freeze(obj) {
      if (typeof obj !== 'object' || obj === null) {
          return obj;
      }
  
      if (!Object.isFrozen(obj)) {
          Object.freeze(obj);
      }
  
      Object.getOwnPropertyNames(obj).forEach(name => freeze(obj[name]));
  
      return obj;
  }
docs: Freeze an object (typeof 'object' && !null), and object properties recursively (owned and enumerable).
  
  This does not guarantee immutability, but it's better than nothing. It's also a compromise to try and avoid freezing objects which may be referenced elsewhere.
  
  @param {Object} obj - The object to be recursively frozen.